shadowline
Merging two arrays together is a one step command called array_merge.

First we will start with our original pantry array and a second array :
<?php
$pantry = array(
   1 => "apples",
   2 => "oranges",
   3 => "bananas"
   );
$pantry2 = array(
   1 => "potatoes",
   2 => "bread",
   3 => "tomatoes"
   );
?>


Now to combine them into one...
<?php
$pantry_food = array_merge ($pantry, $pantry2);
?>

The newly formed array called "pantry_food" will contain all 6 entries from the two arrays. The index for pantry_food will appear from 0 to 5. Visually, it would look like this...
$pantry_food[0] = "apples";
$pantry_food[1] = "oranges";
$pantry_food[2] = "bananas";
$pantry_food[3] = "potatoes";
$pantry_food[4] = "bread";
$pantry_food[5] = "tomatoes";

shadow

Advertise in the banner along the top, Click here!

Valid XHTML 1.0 Transitional Valid CSS! Text Link Ads
shadow
shadow