I can do this, but want to understand how to while it: Or should I?

  $tempslices = explode("\r\n", $pizza);
  foreach ($tempslices as $singleslice)
  {
  echo "<a href=\"http://www.foo.org$singleslice\";>$singleslice</a> ";
  }

Still learning :)

John Taylor-Johnston wrote:

> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to