you're trying to split it on a space (" ")... there are no spaces in "tony".

"my name is tony" would prolly output

my
name
is
tony

You could try splitting on "" (nothing), or use a different function which
places a <br> after each character.


Justin






on 11/06/02 1:34 PM, Anthony Ritter ([EMAIL PROTECTED])
wrote:

> Trying to test the function strtok()
> 
> I thought that the following script would output:
> t
> o
> n
> y
> 
> but I get
> 
> tony
> 
> Thanking all in advance.
> Tony Ritter
> .............................................
> 
> <?
> $name="tony";
> $token=strtok($name, " ");
> echo $token."<br>";
> while ($token!="")
> 
> 
> $token=strtok(" ");
> echo $token."<br>";
> }
> ?>
> 
> 
> 
> 


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

Reply via email to