[ create a new paste ] login | about

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

PHP, pasted on Oct 14:
1
2
3
4
5
6
7
8
9
10
11
<?php

$array = array('a:b:c');

$a = $b = $c = array();

foreach($array as $loop) {
    list($a[], $b[], $c[]) = explode(':', $loop);
}

var_dump($a, $b, $c);


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


Create a new paste based on this one


Comments: