Articles added in Mathematics Lab | Cyber Lab is now open | Astronomy Lab is now open | VLSI Lab is now open | 120 SEO Tips article published | More exciting articles coming soon!

PHP Array and Maps

Predefined Array Functions:

Array_reverse() Returns array in reverse order.
Sort() Sorts an array in the ascending order.
Count()/ sizeof() Counts the number of elements in an array.
Array_change_key_case() Changes the case to either upper or lower case.
Array_diff() Returns the difference between the values.
Array_sum Returns the sum of all the values in an array.

Array_Map in PHP:

  • Array_map function in php is used to return the altered values the array after sending it to a user defined function.


  • Thus the array_map() returns the altered values of a1.

  • NOTE: The function name passed should be enclosed in double quotes.

  • Thus the array_map is useful if I want to use a function for ever value of that array. In the above example myfunction() is called the callback function.

  • Here, Strtoupper() converts the lower case letters to upper case.

    CACKLE comment system

  • Programming Resources
    Computer Networking Fundamentals Android Application