PHP Tutorial (& MySQL) #28 - The Explode Function

preview_player
Показать описание
Hey, in this PHP we'll take a look at the explode function - and how we can use it to turn our comma separated list of ingredients into an array of ingredients instead.

----------------------------------------

🐱‍💻 🐱‍💻 Course Links:

🤑🤑 Donate


🎓🎓 Find me on Udemy

Рекомендации по теме
Комментарии
Автор

No lie man this is still a fantastic tutorial set to this day. Nicely done

KndyKanesaw
Автор

Best tutorials I have encountered so far, I learned more from here than our online classes. Thank you!

shanicaries
Автор

awesome tutorials, best teacher ever!!!

rtagliavia
Автор

Thank you for your tutorials. They are useful and interesting.. Now if I may suggest a little improvment, it will be to use <pre> when it comes to print arrays for best readibility:
echo '<pre>';
print_r('myArray');
echo '</pre>';

elhabibbirouk
Автор

Thank you for showing how to use the explode function().

srinivasaraoyp
Автор

Your tutorials are great, keep up the great work

drentahiri
Автор

U r doing a wonderful job
pls make a video on your journey

thiyagutenysen
Автор

I made it alternatively putting explode into a variable to have a better overall understanding:

outside html:
<?php $pizzaexplosion = explode(", ", $pizza['ingredients']); ?>

and then inside html:
<li> <?php foreach($pizzaexplosion as $ing) {echo ; } ?> </li>


OR ALTERNATIVELY in order to have new lines using just one <li> but without using <br> :

<ul>
<?php foreach($splodcine as $carattcin) { ?>
<li> <?php echo ?> </li>
</ul>

Tuttigiu
Автор

Thank you very much, you have helped me out. You are doing great Sir.👌

itumelengmongwegi
Автор

@The Net Ninja, thank you very much. God bless you!

sureboi
Автор

We love you Shaun! Is the Vue + Laravel series still in the pipeline?

pfodtakem
Автор

Very nice Tutorial Shaun, Thank you so much Shaun!

atishmhatre
Автор

explode() function sounds good. hahaha

zahidshaikh
Автор

would it be better to but ', ' as a delimiter string instead? (the comma AND the SPACE between the ingredients)

cedric_ds
Автор

I want to display comma separated images from single column in an carousel, i tried same function but getting error

dhirajpardeshi
Автор

Another way to do this is use js split func.

shuttereffct
Автор

Hello my code errors
Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in on line 20
Warning: Invalid argument supplied for foreach() in on line 37
what shall I do ?
My code look the same with Mr.Shaun!

nangseakheng
Автор

Can you please tell me what this error means "Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, bool" and "Warning: mysqli_fetch_all() expects parameter 1 to be mysqli_result, bool ". Its driving me crazy, I even copied the code from your github for lesson 27 but i still get the same error.

yamacode
Автор

Hey Shaun thanks... there are some unwanted space between the li tag how can i erase it?

deejayerick
Автор

Please Mr.Net ninja do larevel framework next. Php without a framework is like a bike with one wheel. You can ride it but it will be really hard.

natnaelghirma