I'm trying to extract values from an array within an array. The code I have so far looks like this:
$values = $request->request->get('form');
$statusArray = array();
foreach ($values->status as $state) {
array_push($statusArray, $state);
}
The result of doing a var_dump on the $values field is this:
array (size=2)
'status' =>
array (size=2)
0 => string 'New' (length=9)
1 => string 'Old' (length=9)
'apply' => string '' (length=0)
When running the above I get an error basically saying 'status' isn't an object. Can anyone tell me how I can extract the values of the array within 'status'??
var_dump($values);would be helpful