List of PHP array programs with examples

PHP is a server scripting language, and It is a powerful tool for making interactive and dynamic Web-pages. I have used WampServer 2.2 for following exercise.

  1. Write a PHP script which will display the Cars in the following way using array
  2. Write a PHP script to get the Second element of the above array
  3. Write a PHP script that inserts a new item in an array in any position
  4. Write a PHP script to calculate and display average temperature, five lowest and highest temperatures
  5. Write a PHP script which displays all the numbers between 50 and 150 that are divisible by 4
  6. Write a PHP script to get the shortest/longest string length from an array
  7. Write a PHP script to generate unique random numbers within a range
  8. Write a PHP function that returns the lowest integer that is not 0
  9. Write a PHP script to sort an array in reverse order (highest to lowest)
  10. Write a PHP function to set union of two arrays

Leave a Comment