The explode() function breaks a string into an array.It Returns an array of strings, each of which is a substring of string formed by splitting it on boundaries formed by the string delimiter. Example:
explode()
$values = "val1 val2 val3"; $splitValues = explode(" ", $values); echo $splitValues[0]; // val1 echo $splitValues[1]; // val2 echo $splitValues[3]; // val3
The explode() function breaks a string into an array. It return an array of string, each of which is a substring of string formed by splitting it on boundaries formed by the string delimiter.
EX.
$val = "val1 val2 val3"; $splitVal = explode(" ", &val); echo $splitVal [0]; echo $splitVal [1]; echo $splitVal [2];
The explode() function breaks a string into an array.
syntax: explode(separator,string,limit)
example : <?php $str = "Hello world. It's a beautiful day."; print_r (explode(" ",$str)); ?>