How to merge /append arrays? |
[eluser]umbongo[/eluser]
if i have array1('abc','def','ghi') and array 2 ('jkl','mno') how can i merge/ append them to get array3('abc','def','ghi','jkl','mno') ???
[eluser]Lurius[/eluser]
[quote author="umbongo" date="1291004846"]if i have array1('abc','def','ghi') and array 2 ('jkl','mno') how can i merge/ append them to get array3('abc','def','ghi','jkl','mno') ???[/quote] array_merge
[eluser]Unknown[/eluser]
you can use the php function array_merge like this: Code: $array1 = array('abc','def','ghi'); It you print: Code: array ( 'abc','def','ghi', 'jkl','mno')
[eluser]skunkbad[/eluser]
The php documentation at php.net is your friend. There are many array functions in php, and in many cases you can find a function that will do exactly what you want it to do. Other times you have to get creative and make your own functions.
[eluser]zhangshjin[/eluser]
There are many array functions in php, and in many cases you can find a function that will do exactly what you want it to do. |
Welcome Guest, Not a member yet? Register Sign In |