I have an array variable $var. When I var_dump($var), it shows the following:
array(2) {
[0] => array(3) {
["name"] => string(7) "Ferrari"
["speed"] => int(120)
["isActive"] => bool(true)
}array(3) {
["name"] => string(7) "Porsche"
["speed"] => int(100)
["isActive"] => bool(false)
}
}
The question is: I want to access these values. For example, i want to save the speed value of Ferrari into a variable $speed.
Something like check every element of array, If "name" = Ferrari, Set $speed= corresponding int value of choosen element of array.
What is the syntax of this in PHP.
Thanks in advance.