Workingwith Arrays in PHP

posted by Scudyen date: Thursday, May 22, 2008 category: PHP

Arrays are a large collection of key/value pairs can stores multible variables in a single variable. Arrays are an ordered map which each key could be mapped to a value.

Let's see an example :

Syntax of Array :
$array[key] = value;

Example :


$siteLinks[0] = "http://www.dotnetindex.com"
$siteLinks[1] = "http://www.gazatem.com"
$siteLinks[2] = "http://www.gportal.biz"
?>

In this example we have created an array named siteLinks and we have put some values to each key. After creating an array we can retrieve value calling array with mapped key :

echo
$siteLinks[2];
?>


Read More

Custom Search



Gazatem Technologies Active News Manager


page counter

Listed with 411asp.net Listed with 4aspin.com