Which predefined PHP function can be used to reverse the order of the elements in an array?
- array_reverse()
- array_flip()
- array_rotate()
- array_shuffle()
The array_reverse() function is used to reverse the order of elements in an array. array_flip() flips the keys and values, while array_rotate() and array_shuffle() are not valid functions.
Loading...
Related Quiz
- Which PHP function is used to read the contents of a file into a string?
- The session data in PHP is stored by default in the ________ directory on the server.
- How do you handle errors when creating a MySQL table using PHP?
- What is the most convenient hashing method to be used to hash passwords?
- You have an array in your PHP script and you're encountering issues with accessing or manipulating the values. How would you debug this?