Example 1
<?php
$pizza = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(" ", $pizza);
echo
echo $pieces[0]; // piece1
echo $pieces[1]; // piece2
?>
output:
piece1 piece2
Example 2
<?php
$myvalue = 'Test me more'; $arr = explode(' ',trim($myvalue));
echo $arr[1]; // will print Test
?>
output: me
0 Comments:
Post a Comment