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!
I just can’t stop reading
I just can’t stop reading this. Its so fresh, so filled with updates that I just didn’t know.
I am delighted to see that people are in fact writing about this subject in such a elegant way,
presenting us all diverse parts to it. You’re a fine blogger. Please carry on with it.
I can’t wait to read what’s after that.Thanks so much fo
crosser Motorbikes
Thanks. Very Nice. Thanks You
Thanks. Very Nice. Thanks You Admin For Sharing.
Post new comment