Split()
| From: | John Taylor-Johnston | Date: | Tue, 17 Feb 2004 16:03:37 +0000 |
| Subject: | Split() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-177961@lists.php.net to get a copy of this message | ||
Can I while this? Not sure how to go about it?
while ($pieces exist) {
echo $pieces[i];
}
Thanks,
John
$pizza = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(" ", $pizza);
echo $pieces[0]; // piece1
echo $pieces[1]; // piece2
http://www.php.net/manual/en/function.explode.php
http://www.php.net/manual/en/control-structures.while.php