Array Functions in PHP

This is a simple array exercise in PHP. There could be many operations on array and some of them that we implemented is given below in the source code.

  Source Code 


<html>
 <title> PHP Arrays Demo </title>
  <body>
  <?php 
    echo "<br />";
    $my_array_1 = array(21, 23, 15, 57, 29 );
    echo "<br />";
  ?>
  <?php
    echo "Array 1 : ";
    print_r($my_array_1);
    echo "<br />";
    echo "Total Length : ";
    echo count($my_array_1);
    echo "<br />";
    echo "Maximum Digit : ";
    echo max($my_array_1);
    echo "<br />";
    echo "Minimum Digit : ";
    echo min($my_array_1);
    echo "<br />";
    echo "After Sort : ";
    echo sort($my_array_1);
    print_r($my_array_1);
    echo "<br />";
    echo "Reverse Sort : ";
    echo rsort($my_array_1);
    print_r($my_array_1);
  ?>
  </body>
</html>

Output of the Program 

Arrays in Php
Arrays Function

Share on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment