When you are developing some application with PHP, then there might be a need to split the contents received from users or to split the contents which are stored in database and its a very common scenario where we can use PHP’s inbuilt function “explode”.

Splitted values can be used for manipulation as the values returned by explode function are “array”, so we can use it.

Checkout the following code its very simple to understand & use.

$string = "Some Contents Which Can Be Splitted With PHP Explode Function and Array can be Printed !";
$splitted = explode(" ",$string);
$cnt = count($splitted);
while($cnt > $i)
 echo "$splitted[$i]";
 echo "\n";

Check PHP Manual for PHP Explode Function.

Get latest blog posts in your Mail ! Don't worry, I won't spam your Inbox, I hate spams too ! ! !