Re: Explode a variable into each character
| From: | Rasmus Lerdorf | Date: | Fri, 23 Feb 2001 19:06:42 +0000 |
| Subject: | Re: Explode a variable into each character | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-41359@lists.php.net to get a copy of this message | ||
> I have a string of 1034 and I want to have an array that has each number in
> an element.(ex: num[0] = 1, num[1] = 0, num[2] = 3 num[3] = 4) Is there a
> way to explode a string by each character?
Just convert it to a string: ie. $foo = (string)$num; echo $foo[1];
-Rasmus