| Home > Computer & I'net > Merging Arrays... |
Merging Arrays | |
Merging two arrays together is a one step command called array_merge. <?php 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"; ----------------- Article by David Stanley. Visit his site http://www.htmlite.com. Reprinted with permission. | |
| Articles |
•Auto & Trucks•Business•Computer & I'net·General·Apache·CSS·Database·Hardware·HTML·Javascript&DHTML·Linux·MySQL·Operating System·Perl / CGIPHP·Programming·Publishing·Search Engines·Software Problems·SSI·Tips & Tricks·Utilities·Web Design•Family•Food & Drink•Gardening•Health•Other•Pets•Psychology•Spiritual•Travel•Women |
| Calculators |
|