PHP explode() Function

The explode() function is use to breaks a string into an array.

Demo :



Enter Text :  

Example :

Comma - Separated List : "butter, milk, sugar, salt, flour, caramel"

Following code is used to explode() function demo code If you need to copy and use your web site.


<?php
$explode_fun = "butter, milk, sugar, salt, flour, caramel";
$ingredientsArr = explode(", ",$explode_fun);
foreach ($ingredientsArr as $i)
{
  print $i . "\r\n<br>";
}
?>

The explode() function have in the three arguments that name is string separator,string str,[int limit]. In the above code is makes split a comma - separated string list into an array of individual list elements.

Free Download Script :

If you need explode() function demo code download from following link.

Download




Content