explode

Syntax:array explode ( string $delimiter , string $string [, int $limit ] )

Description:explode — Split a string by string

Return Values
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 1

<?php
// Example 1
$items  = "item1 item2 item3 item4 item5";
$items = explode(" ", $items);
echo "Output As Array:";
echo "<br/>";
print_r($items);
echo "<br/>";
echo $items[0]; // items1
echo "<br/>";
echo $items[1]; // items2
?>

OUTPUT

Output As Array:
Array ( [0] => item1 [1] => item2 [2] => item3 [3] => item4 [4] => item5 )
item1
item2