Re: strtok()

From: Date: Tue, 11 Jun 2002 02:41:10 +0000
Subject: Re: strtok()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-101490@lists.php.net to get a copy of this message
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 (tony@gonefishingguideservice.com) 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>"; > } > ?> > > > >

« previous php.general (#101490) next »