There are two types of arrays we deal with in PHP.
- Numeric Arrays
<?php $employee_names[0] = "Raj";
$employee_names[1] = "Thomas";
$employee_names[2] = "Anil";
echo "The first employee's name is ".$employee_names[0];
echo "<br>";
echo "The second employee's name is ".$employee_names[1];
echo "<br>"; echo "The third employee's name is ".$employee_names[2]; ?>
Associative Array
<?php $employee_names = array("arun" => "Owner", "balu" => "Manager", "Thomas" => "Peon");
echo "Matt is the ".$employee_names["balu"]; ?>
Incoming search terms:
- array in php (1)
- Arrays in PHP (1)
You will also be interested in ,
- Displaying or changing images each day
- How to create random passwords using php
- Simple PHP Login Script
- Hit counter using php
- Simple Javascript Slideshow
- How to display popular posts in wordpress
- Get IP address using gethostbyname() function
- Display Tags in wordpress
- .htaccess some facts and rules
- Water mark images using PHP 5 and GD Library

Very simple array tutorial