PHP Array is that kind of structure where lots of value can be stored in a variable. If we want to declare a variable A to Z character. At that time we need to use PHP Array. Otherwise, we have to create single variable for every character?s, it will arrange lots of variable which one is very difficult to count such huge variable. New, if we can use all character in a variable, it will be must better for us.
In PHP, there are three kinds of arrays:
# Numeric array - An array with a numeric index
# Associative array - An array where each ID key is associated with a value
# Multidimensional array - An array containing one or more arrays
Since, in PHP Array variable have lots of value, so if we want to count or call variable to display that value write $student, $student, $student sequencely. Here 0 is index number. Example is given below.
PHP code Numeric array :
Associative array is very important and populer array now. In Associative array lots of value can be stored in a variable.
echo $student; ?>
Note:According to above example $student; will display Rahim.
Example of Associative Arrays
$student=array('jamal'=>'E00221', 'Rahim'=>,'E00331', 'Hasan'=>'E00421')
echo $student["Rahim"]; ?>
Note:According to above example ['Karim'] is key and "E00221" is value.