I have an array like the example shown below. I want to echo a specific value. Right now what I am doing is:
$array[0]->Question
So, it outputs: Question1
But I dont want this solution.
Is there any way to echo specific value without key, for example (its not solution):
$array[]->Field == 'Field1' ? $array[]->Question : '';
Please suggest a solution.
Thanks!
[Required] => Array
(
[0] => stdClass Object
(
[Field] => Field1
[Question] => Question1
[DataType] => Boolean
)
[1] => stdClass Object
(
[Field] => Field2
[Question] => Question2
[DataType] => varchar
)
[2] => stdClass Object
(
[Field] => Field3
[Question] => Question3
[DataType] => Boolean
)
[3] => stdClass Object
(
[Field] => Field4
[Question] => Question5
[DataType] => Int
)
)
Questionby providing the value ofField?