I have this array of std class object:
$myarray =
Array
(
[0] => stdClass Object
(
[text] => lorem lorem
[src] => web
)
[1] => stdClass Object
(
[text] => ipsum ipsum
[src] => book
)
)
and I have a $value = "lorem lorem", that I want to look up in the array and return the src of that object.
here is my attempt:
foreach($myarray -> 'text' as $key => $text_value){
if($value == $text_value){
$new_src = $myarray -> 'src';
}
}
$myarray -> 'text'??