Re: **{SPAM}** [PHP-DB] numeric string to single digit array

From: Date: Wed, 26 Mar 2008 00:11:45 +0000
Subject: Re: **{SPAM}** [PHP-DB] numeric string to single digit array
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-44790@lists.php.net to get a copy of this message
Richard, Someone might have a quicker/better way, but what about: <?php $numbers = '1223123'; $numberarray = str_split($numbers,1); print_r($numberarray); ?> Thanks, --Dustin Richard Dunne wrote:
Can anyone tell me how how to convert a string of integers into an array of single digit integers. i.e. "1223123" into ['1','2,','2','3','1,'2','3'] ? When I retreive a column of single digit integers I end up with a long string of numbers. I think PHP is seeing this as one whole number and therefore is not splitting or exploding it. I hope I am wrong in my thinking and there is a simple solution, though I am not seeing it. Can anyone help me? Richard.


« previous php.db (#44790) next »