Re: String to an Array
| From: | Jason Wong | Date: | Fri, 06 Dec 2002 18:52:25 +0000 |
| Subject: | Re: String to an Array | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-127301@lists.php.net to get a copy of this message | ||
On Saturday 07 December 2002 02:12, copperwalls@hotmail.com wrote:
> Hello,
>
> "Rodrigo de Oliveira Costa" <thenewsource@ieg.com.br> wrote:
> > Hi guys, I got a string that I need to be transformed into na array of
> > characters, something like:
> >
> >
> > $str ="im the one trying to do this";
> >
> > //this is the string
> >
> > I'd like to get an array that I can access something like $array[0] and
> > get the value " i ". And this foward. Anyone have any clues on this?
>
> You can actually treat $str "like" an array so
>
> $str[0]
>
> would be "i".
This isn't officially endorsed anymore. You should use $str{0} instead.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
The new Congressmen say they're going to turn the government around. I
hope I don't get run over again.
*/