Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2006
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    php array push function?

    I have two arrays of arrays of arrays. Is there an easy way get one array that is a combonation of the two?

    Thanks!

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Take a look at all these array functions. I'm not sure what you're doing, but these should take care of it: http://us.php.net/manual/en/book.array.php

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    Regular Coder Zangeel's Avatar
    Join Date
    Oct 2007
    Location
    public_html/
    Posts
    638
    Thanks
    17
    Thanked 79 Times in 79 Posts
    Can you post the arrays you have.
    PHP Code:
    $aString is_string((string)array()) ? true false// true :D 
    [/CENTER]

  • #4
    New Coder
    Join Date
    Aug 2009
    Posts
    26
    Thanks
    1
    Thanked 3 Times in 3 Posts
    you have to use
    $result = array_merge($array1,$array2)
    dont use array_push. It will just insert the whole array2 as an element or array1. which is not the required result..
    Reference
    http://us.php.net/array_merge
    http://us2.php.net/array_push


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •