Re: Convert a string to an array
| From: | Scott Fletcher | Date: | Wed, 23 Oct 2002 16:31:41 +0000 |
| Subject: | Re: Convert a string to an array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-121127@lists.php.net to get a copy of this message | ||
I never see this one to work for the array, "$word{$z};" with a " { " or "
}
" instead of the bracket.
"Rick Emery" <remery@emeryloftus.com> wrote in message
news:027b01c27aa7$8f9774b0$0500a8c0@honeybee...
> where is $z set???
>
> ----- Original Message -----
> From: "WANDA HANSEN" <scriptsjoint@earthlink.net>
> To: <>
> Sent: Wednesday, October 23, 2002 9:38 AM
> Subject: [PHP] Convert a string to an array
>
>
> Hello,
>
> I am having trouble converting a string to an array.
>
> I have been trying the following:
> $len = strlen($word);
> for($count=0;$count<$len;$count++)
> {
> $w[$z] = $word{$z};
> }
>
> It appears to create an array, but when I try and shuffle it
>
> $w=shuffle($w);
>
> I get the following error:
>
> Warning: Cannot use a scalar value as an array in
> /home/taylor94/public_html/jumble/stringshuffle.php on line 68
>
> Any help would be appreciated.
>
> Thanks,
> Wanda
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>