What is the difference between array_map () and array_shift ()?



What is the difference between array_map () and array_shift ()?..

Answer / Ashmita Tiwari

array_map() in PHP applies a user-defined function to every element of an array, creating a new array. On the other hand, array_shift() removes the first element from an array and returns it, while modifying the original array.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

How do you destroy a session?

1 Answers  


Give the case where we can use get and we can use post methods?

1 Answers  


How to make a file encrypt and decrypt?

4 Answers   3i Infotech,


How do you check if a variable has been set in php?

1 Answers  


What is helper function?

1 Answers  


What is the default time in seconds for which session data is considered valid?

1 Answers  


Does facebook use php framework?

1 Answers  


Explain different sorting function in php?

1 Answers  


How arrays are passed through arguments?

1 Answers  


how to work lamp server

0 Answers  


display selected value in dropdown list through javascript without page refresh

1 Answers  


What are helpers in php?

1 Answers  


Categories