Arrays in PHP

In program we will discuss about Arrays in Php Programming. Arrays are the collection of Data representation. In our example we take two Arrays and Save some numbers in these arrays. And after that we manipulate Arrays and display the Arrays data.

Source Code 


<html>
 <title> PHP Arrays Demo </title>
  <body>
  <?php 
    echo "<br />";
    $my_array_1 = array(1, 3, 5, 7, 9 );
    $my_array_2 = array(2, 4, 6, 8, 10 );
    echo "<br />";
  ?>
  <?php
    echo "Array 1 : ";
    print_r($my_array_1);
    echo "<br />";
    print_r($my_array_2);
    echo "<br />";
    echo $my_array_1[0];
    echo "<br />";
    echo $my_array_2[0];
    echo "<br />";
    echo $my_array_1[1];
    echo "<br />";
    echo $my_array_2[1];
    echo "<br />";
    echo $my_array_1[3];
    echo "<br />";
    echo $my_array_2[3];
  ?>
  </body>
</html>


Output of the Program 

Arrays in PHP

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