PHP Tutorial 20 - Explode (PHP For Beginners)

preview_player
Показать описание
The Explode function will allow you to split a string up by the string that you declare. So you could split a paragraph up into sentences by splitting it by a full stop or even split a sentence up into words by splitting it by a space. This video will show you how to explode a string and then access each string stored inside arrays.

For more information, check out the website:

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

your tutorials are awesome man. Seriously, I learned more by watching your videos in 1 day than I learned in 6 months at my college.

cyrusthegreat
Автор

this video is really nice....helped me a lot thank you so much uploader

honeylynpascual
Автор

i'm learning a lot form you, thank you very much!

damiandevlin
Автор

Nice tutorial, thank, you earned a sub and a recomendation to all my friends

ValtteriV
Автор

@TeachMeComputer Amazing videos, I just started learning today and I love it

DubstepPLZ
Автор

This can be used in for Interface files separated by "|". Extremely useful in EDI transmissions.

lopejustin
Автор

this actually really helped me thanks, btw im also from liverpool (you sound like you have a scouse accent)

sashablfc
Автор

Great series of videos.  I'm humbled that you were only 18 when you made these.  Wow.  How would you explode on more than one condition?  For example the last element of the array contains the period.  Sentences might also have commas and other punctuation you would want to eliminate at the same time, no?

tbyers
Автор

Many times you have a string which has a repeatable 'delimiter'. You might want to look for a particular piece of the string. so you convert it into an array by this and then run over the array.

uddayshank
Автор

Thanks for such a cool Tutorial. But can you tell me the the practical use of this function?

HimanshJainYTube
Автор

hmm question... is there a simular code for explode, but then with more parameters... because it said it can only take up to 3 parameters...

cputurbopc
Автор

Chris, I have looked through your tutorials and cannot find one regarding dynamic sites and loading dynamic title/meta info from mysql, any chance of a tutorial. I have all the files and DB but this is a problem I have been trying to resolve for a week now. Any chance of a tutorial? Thanks

dashbyictfd
Автор

I couldn't understand the last part "echo $parts[1];"
why does it give back only H?

arijitdutta
Автор

Sir please tell me that how to add the break between two print

MyAffanali
Автор

How do i code a function that processes colon separated strings using the explode function?

lebogangsekaleli
Автор

Could you please explain what the explode function is used for in real live scripts please?
Thank you

Travailleradomicile
Автор

*2:12** Why does it output an Array, when you have not used the Array Function?*

dissdad
Автор

Thanks for the tutorial, but i don't see any point using the explode function.

anonymousvagrant
Автор

What is the difference between "print_r" and "echo"?

mohitsharma
Автор

that is the source of the tutorial

<?php
/* The first example
$sentence = 'I am enjoying the PHP video tutorials.';
$parts = explode(' ', $sentence);
print_r($parts);
*/

$sentence = 'I am enjoying the PHP video tutorials.';

$parts = explode('P', $sentence);

echo $parts[1];

?>

bogoreh