[ create a new paste ] login | about

Link: http://codepad.org/HKAF6ZXR    [ raw code | output | fork ]

PHP, pasted on Oct 21:
1
2
3
4
5
<?php
$foo = 2468;
$array = array_map('intval', str_split($foo));

var_dump($array);


Output:
1
2
3
4
5
6
7
8
9
10
array(4) {
  [0]=>
  int(2)
  [1]=>
  int(4)
  [2]=>
  int(6)
  [3]=>
  int(8)
}


Create a new paste based on this one


Comments: