Using the explode function PHP
We can use the explode function to separate a sentence into two or more. The string is being separated via a string too.
The explode function will look for a string in a string and separates the string when he encounter the string it is looking for.
To use this function lets take this string for example.
$sample = "We will explode this sentence.";
$newString = explode("explode",$sample);
echo $newString[0].’ ‘.$newString[1];
This will display the following text.
We will
this sentence.
So the more explode string is inside that sentence the more the sample sentence will be divided and will be stored in the $newString as an array.







