I have the following array, which has some extra character in the value "/".
Array
(
[ID1] => 362/2
[ID2] => 589/3
[ID3] => 697/4
[ID4] => 111/5
[ID5] => 422/6
)
what I want to achieve and get is as follows
Array
(
[ID1] => 362
[ID1] => 2
[ID2] => 589
[ID2] => 3
[ID3] => 697
[ID3] => 4
[ID4] => 111
[ID4] => 5
[ID5] => 422
[ID5] => 6
)
And, I have tried to write script in php to solve the above issues...
$exp = array();
foreach ($value as $val) {
$pl = explode('/', $val);
$exp[] = $pl[0] ."=>".$pl[1];
}
print_arr($exp);
But, I got the following result, In which it is wrong...
Array
(
[0] => 362=>2
[1] => 589=>3
[2] => 697=>4
[3] => 111=>5
[4] => 422=>6
)
how do I do it? some help please?