Friday 28 November 2014

Arrays in PHP

Structure of the Problem Requirements 

In programme we will discuss about Arrays in Php Programming. Arrays is 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. Here is the source code of programme which help you in better understanding.

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
Php Arrays 

 

Share it Please
asad

About Author!

Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.

0 comments:

Post a Comment