I am working on Flight api. I am sending the request(From location,To location,From date..etc) and i am getting the response in the array format as below.
Array
Ok First let me show you how to do this using a simple example
$myArray = array();
$myArray[] = array('name'=>'Russell');
$myArray[] = array('name'=>'Sam')
foreach($myArray as $list)
{
print $list['name'];
}
you can see what this example shows is it will loop through each array and get the name.
Now lets do a sub array in an array
$myArray = array();
$myArray[] = array('name'=>'Russell', 'about_me'=>array('age'=>22));
$myArray[] = array('name'=>'Sam', 'about_me'=>array('age'=>32))
foreach($myArray as $list)
{
print $list['name'];
}
foreach($myArray as $list)
{
print $list['name'];
print $list['about_me']['age']; <-- this will print about the age of the person.
}