Add strings to array PHP -


Hello I have string 1, array [] and $ string2. I want to create an Arrayue [], such as

  array [0] = $ string1 array [1] = array [0]. . Arraynew [n-1] = array [n] Arraynew [n] = $ string2  

The problem is that I do not know how many elements are in the array [] because it is parsed

Please help me.

Thank you.

In the beginning of the array, insert one or more elements. At the end of the array, one or more elements will be added. Therefore:

  $ new_array = $ array; Array_unshift ($ new_array, $ string1); Array_push ($ new_error, $ string2);  

Comments