help me split chars w/o spaces by 2... like: 2004
| From: | Louie Miranda | Date: | Thu, 09 Dec 2004 01:55:57 +0000 |
| Subject: | help me split chars w/o spaces by 2... like: 2004 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-203778@lists.php.net to get a copy of this message | ||
Help me split chars w/o spaces by 2... like: 2004
How can i make it?
first: 20
second: 04
Im working on this..
##### begin code
$year_split = date("Y");
$chars = preg_split('//', $year_split, -1, PREG_SPLIT_NO_EMPTY);
##### end code
But it splits the whole "2004" string..
Array
(
[0] => 2
[1] => 0
[2] => 0
[3] => 4
)
--
Louie Miranda
http://www.axishift.com