[ create a new paste ] login | about

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

balajimca - PHP, pasted on Feb 4:
1
2
3
4
5
6
7
8
<?php
$responses = array('A=1', 'B=2', 'C=3');
foreach ($responses as $value) {
    $split = explode('=', $value);
    $array1[$split[0]] = $split[1];
}
print_r($array1);
?>


Output:
1
2
3
4
5
6
Array
(
    [A] => 1
    [B] => 2
    [C] => 3
)


Create a new paste based on this one


Comments: