1

Sorry i am beginner in PHP. I have a problem with an array.

Array
(
    [Edisi] => 174|September|2001| 
)
Array
(
    [Pengantar] => Dear All.... 
)
Array
(
    [Tema] =>  Sami Mawon 
)
Array
(
    [Tema_isi] => **sesuatu!!!**
) 

If i want to make to be like

Array
(
    [Edisi] => 174|September|2001|
    [Pengantar] => Dear All.... 
    [Tema] =>  Sami Mawon 
    [Tema_isi] => sesuatu!
)

How might I go about achieving it?

0

1 Answer 1

4

Have a look at the manual page for array_merge()

Merges the elements of one or more arrays together so that the values of one are appended to the end of the previous one. It returns the resulting array.

If the input arrays have the same string keys, then the later value for that key will overwrite the previous one. If, however, the arrays contain numeric keys, the later value will not overwrite the original value, but will be appended.

Values in the input array with numeric keys will be renumbered with incrementing keys starting from zero in the result array.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.