PHP Arrays Can Store multiple values in single Varible. Let’s think that you have a list of cars like ( ‘BMW’, ‘Honda’, Swift, ‘XUV’ )
But you want to separate this by categories like sport car, xuv.
But you need to put it in a single varible then you need two arrays
## Let's Solve this By Programming
<?php $sport_cars = array('BMW', 'Honda'); $xuv_cars = array('Swift', 'XUV'); echo "Sport Cars List: " . $sport_cars . ", " . $sport_cars . "."; echo "XUV Cars List: " . $xuv_cars . ", " . $xuv_cars . "."; ?>
Output: Sport Cars List: BMW, Honda. XUV Cars List: Swift, XUV.
Note That: array is Index from 0 to n you can access each value by passing there
index number to variable like follows
Like That you can access the element in array