[ create a new paste ] login | about

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

PHP, pasted on Feb 28:
1
2
3
4
<?php
$s = "1,2,3,8,2";
$ints = array_map('intval', explode(',', $s ));
var_dump( $ints );


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


Create a new paste based on this one


Comments: