PHP explode function is a powerful and very useful php string function especially if you want to parse querystrings.
explode -- Split a string by use of a string separator, returns the parsed strings to array.
explode -- Split a string by use of a string separator, returns the parsed strings to array.
// Example 1
$yellow = "sponge1
sponge
2
sponge
3
sponge
4
sponge
5
sponge
6";
$pieces = explode(" ", $yellow);
echo $pieces[0]; // piece1
echo $pieces[1]; // piece2
// Example 2
$data = "foo:*:1023:1000::/home/foo:/bin/sh";
list($user, $pass, $uid, $gid, $gecos, $home, $shell) = explode(":", $data);
echo $user; // foo
echo $pass; // *
?>