Re: string to array

From: Date: Wed, 12 Feb 2003 20:24:38 +0000
Subject: Re: string to array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-135357@lists.php.net to get a copy of this message
"Kevin Waterson" <kevin@oceania.net> wrote: > What is the best method to convert a string to an array > > I need to able to loop through each letter of the string > not just use $string[47] You can find out how long it is using strlen(), then loop through it using your favorite looping construct. You could also easily convert it to an array at that point, but unless you need each character as an array element for a later operation it doesn't seem very efficient. I don't think explode() will let you use a separator of '', but you might look at that as well. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/

« previous php.general (#135357) next »