In this page we will learn about PHP Array. We will also understand how to use PHP Array in your PHP program. The PHP Array is very useful in developing PHP based applications.
PHP Arrays are ordered map which is used to stored values in key value pair. Here is simple example of PHP array:
$fruit_array = "Apple";
$fruit_array = "Banana";
$fruit_array = "Pine Apple";
$fruit_array = "Mango";
$fruit_array = "Pear";
To print the value of stored at index 3 you can use following code:
<? echo $fruit_array ?>
Following code shows how to create simple array:
// Create a simple array.
$my_array = array(1, 2, 3, 4, 5,6,7,8);
You can also create using following code:
$a = array(1 => 'one', 2 => 'two', 3 => 'three');
Check more at PHP Tutorials Index.More Tutorials on roseindia.net for the topic PHP Array.