Re: each (explode ()) invalid?
| From: | Andreas Pour | Date: | Tue, 18 Jul 2000 19:28:20 +0000 |
| Subject: | Re: each (explode ()) invalid? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7134@lists.php.net to get a copy of this message | ||
Hi,
Of course it spins, you re-'explode' the string on each iteration of the
loop, so you are always getting the first word in the 'string'.
Ciao,
Andreas
Albert Chin-A-Young wrote:
>
> Works fine:
> $array = explode (" ", $string)
> while (list (, $entry) = each ($array)) {
> }
>
> This seems to spin:
> while (list (, $entry) = each (explode (" ", $string))) {
> }
>
> --
> albert chin (china@thewrittenword.com)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net