I have searched for hours and cannot find the answer.
I have 2 arrays that will always be the same length
array_a(12, 13, 14);
array_b(15, 18, 20);
How would I print to 3 different variables (or arrays) like so...
$array_c(12, 15);
$array_d(13, 18);
$array_e(14, 20);
So they line up.
Thanks
Okay I figured it out. I guess I should explain what I was trying to do better so that the code is easier to understand. I have an application in which a user can enter room sizes for the square footage of a room. Because all rooms are not always square, I wanted to be able to allow the user who had a "L" shaped room to divide the room up and enter multiple measurements for each room. So they could add another row to a table to add the length and width for the bottom of the "L". (I know its hard to explain) Anyway, the user could submit 2 squares for a room that is odd shaped. Since my database only has 1 row per room, I figured it would be better to add multiple measurements inside of the same field separated by a space which I could explode later if I need to. Anyway, this is what I came up with
$width = $_POST['width']; //an array
$length = $_POST['length']; //an array
$dimensions_array = array();
foreach ($width as $key => $value) {
$individual_length = $length[$key];
array_push($dimensions_array, $value.'x'.$individual_length);
}
$dimensions = implode(' ', $dimensions_array);
This returns an array called $dimensions that is (12x15 13x18 14x20)