I have array like this
stdClass Object (
[0] => stdClass Object ( [field_id] => 10 [value] => 46426 [value_integer] => 0 )
[1] => stdClass Object ( [field_id] => 9 [value] => 1987 [value_integer] => 0 )
[2] => stdClass Object ( [field_id] => 8 [value] => 558/65 [value_integer] => 0 )
[3] => stdClass Object ( [field_id] => 7 [value] => Sturpolj [value_integer] => 0 )
[4] => stdClass Object ( [field_id] => 6 [value] => 1 [value_integer] => 0 )
[5] => stdClass Object ( [field_id] => 5 [value] => 6 [value_integer] => 0 )
[6] => stdClass Object ( [field_id] => 3 [value] => [value_integer] => 0 )
[7] => stdClass Object ( [field_id] => 4 [value] => 4 [value_integer] => 0 ) )
and for another row looks like this
stdClass Object (
[0] => stdClass Object ( [field_id] => 11 [value] => 555 [value_integer] => 0 )
[1] => stdClass Object ( [field_id] => 10 [value] => 19574 [value_integer] => 0 )
[2] => stdClass Object ( [field_id] => 9 [value] => 1972 [value_integer] => 0 )
[3] => stdClass Object ( [field_id] => 8 [value] => 192/34 [value_integer] => 0 )
[4] => stdClass Object ( [field_id] => 7 [value] => Munchen [value_integer] => 0 )
[5] => stdClass Object ( [field_id] => 6 [value] => 3 [value_integer] => 0 )
[6] => stdClass Object ( [field_id] => 5 [value] => 2 [value_integer] => 0 )
[7] => stdClass Object ( [field_id] => 4 [value] => 1 [value_integer] => 0 )
[8] => stdClass Object ( [field_id] => 3 [value] => [value_integer] => 249000 )
[9] => stdClass Object ( [field_id] => 2 [value] => p+1+2 [value_integer] => 0 )
[10] => stdClass Object ( [field_id] => 1 [value] => 30% [value_integer] => 0 ) )
and I want to print only value where [field_id] is equal to 9.
So the results would be for the first row 1987 and for the second 1972.
The problem is that number of results in each row are different so I can't use "echo $results[2]->value".
I should use something like this instead "echo $results[field_id][9]->value"
How can I print this?
Many thanks.