Re: string to array
| From: | Tom Rogers | Date: | Fri, 08 Nov 2002 13:15:03 +0000 |
| Subject: | Re: string to array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-123369@lists.php.net to get a copy of this message | ||
Hi,
Friday, November 8, 2002, 10:43:10 PM, you wrote:
MK> Hi all,
MK> has anyone an elegant (and faster) way of converting 'string' to
MK> array('s','t','r','i','n','g'),
MK> other then
MK> for($i=0; $i<strlen($string); $i++) $array[$i]=$string[$i];
A string is already an array of chars
$string = 'string';
echo $string[0]; // will echo 's'
--
regards,
Tom