Re: **{SPAM}** [PHP-DB] numeric string to single digit array
[email protected] (Dustin Simpson)
| Newsgroups | php.db |
|---|---|
| Message-ID | <[email protected]> |
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.
>
>
>