Create array

An array can store multiple values in one variable..

Below is the example of array in php

$days = array("sun","mon","tue","wed","thur","fri","sat"); //array declaration

we also can declare an array like this

$days[1] = "sun";
$days[2] = "mon";
$days[3] = "tue";

the following example is to print the value in array

echo "Today is:".days[1];

the output is
sun

0 comments:

Post a Comment