How to insert an new array element in array?



How to insert an new array element in array?..

Answer / Lav Kant

To insert a new element into an array, you can use the array_push() function. This appends one or more elements to the end of the array.nExample:n```phpn$arr = [1, 2, 3];narray_push($arr, 4);narray_push($arr, [5, 6]);n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

How can you send email in php?

1 Answers  


Which is the dependent variable?

1 Answers  


What are sql functions?

1 Answers  


Different between the var_dump() and print_r()?

4 Answers  


How to connect to a url in php?

1 Answers  


How do you use an array in excel?

1 Answers  


Is not null mysql?

1 Answers  


How to download a php script directly in your script page?

3 Answers   A1 Technology, Zmanda,


What is strstr php?

1 Answers  


What is the difference between javascript and php?

1 Answers  


Is php easier than javascript?

1 Answers  


What is the role of php?

1 Answers  


Categories