So you're trying to take two sets of arrays in PHP and mash them together right? Well if you're anything like me, you stumlbed accross array_push() first, as it's what shows up in google. Not bad, except that is more of a merge than an append. For example...
You have these two arrays:
array[0] = Apple
array[1] = Orange
array2[0] = pineapple
array2[1] = grape
And you want to have a final array that has all of those items in it, right? Well array_push() takes that second array you feed it, and then jams it right ontop of the prior array. You wind up with an array only containing two items, with 0 being pineapple, and 1 being grape.
The secret my friends is this: array_merge();
Try it. It's so easy to use you'll understand why I didn't feel the need to write any more!
Thanks. Very Nice. Thanks You
Thanks. Very Nice. Thanks You Admin For Sharing.
Post new comment