denny3d
asked on
transform an array into multidimensional array php
hi EE
i have an array like this
Array
(
[0] => 1302 11022009 132V4
[1] => 1302 11022009 132V4
}
can i trasform this array into this?
Array
(
[0] => Array
(
[0] =>1302
[1] =>11022009
[2] =>132V4
)
[1] => Array
(
[0] =>1302
[1] =>11022009
[2] =>132V4
)
}
Array
(
[0] => 1302 11022009 132V4
[1] => 1302 11022009 132V4
}
[0] => Array
i have an array like this
Array
(
[0] => 1302 11022009 132V4
[1] => 1302 11022009 132V4
}
can i trasform this array into this?
Array
(
[0] => Array
(
[0] =>1302
[1] =>11022009
[2] =>132V4
)
[1] => Array
(
[0] =>1302
[1] =>11022009
[2] =>132V4
)
}
Array
(
[0] => 1302 11022009 132V4
[1] => 1302 11022009 132V4
}
[0] => Array
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad this worked, but any particular reason why you feel the solution is only worth a B? I provided exactly what you asked for and even the code to do the reversal.
Just curious if I missed something ;)
Just curious if I missed something ;)
If you wanted to put everything back together in its original form:
<?php
foreach ($new_array as $value) {
$restored_array[] = implode(" ", $value);
}
?>
Which would give you back your original array of values separated by spaces.