Re: strtok()
| From: | Justin French | Date: | Tue, 11 Jun 2002 03:06:30 +0000 |
| Subject: | Re: strtok() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101492@lists.php.net to get a copy of this message | ||
I *think* it's because you don't have an { at the beginning of the while()
loop....
<?
$name="tony";
$token=strtok($name, " ");
//echo $token."<br>";
while ($token!="")
{
$token=strtok(" ");
echo $token."<br>";
}
?>
Or, use the example in the manual as a guide:
<?
$string = "tony";
$tok = strtok($string,"");
while ($tok)
{
echo "{$tok}<br>";
$tok = strtok("");
}
?>
Justin
on 11/06/02 1:58 PM, Anthony Ritter (tony@gonefishingguideservice.com)
wrote:
> Thank you.
> The output is
>
> t
> o
> n
> y
>
> One thing...the server seem to keep running after the output to the browser
> like it's going through an indefinate loop.
>
> Any throughts?
> TR
>
>
>
>