Array in php example

An array is a variable which contains multiple values, these values are indexed by numbers and strings.
We can assign values to an array in the following ways.
Method 1.
Method 2.
In above methods , Php automatically allot index number to values. Index starts from 0 onwords as 0,1,2,3...
We can give index to values manually too .
We access array values by referring index as given below.
print $city[0]." is the capital of India. And ". $city[2]." is union territory."
Result is
Delhi is capital of India. And Chandigarh is union territory.