Array
(
[0] => stdClass Object
(
[comment_ID] => 31
[comment_post_ID] => 16
[comment_karma] => 0
[comment_approved] => 1
[comment_parent] => 0
)
[1] => stdClass Object
(
[comment_ID] => 32
[comment_post_ID] => 16
[comment_karma] => 0
[comment_approved] => 1
[comment_parent] => 31
)
[2] => stdClass Object
(
[comment_ID] => 33
[comment_post_ID] => 16
[comment_karma] => 0
[comment_approved] => 1
[comment_parent] => 30
)
)
<?
foreach ($array as $comments)
{
$key = array_search ("30", $comments);
echo $key;
}
?>
I'd need to retrieve the array key where its located for comment_parent 30 which is in [2] array. I've tried with array_search but i'm getting this error:
Warning: array_search() expects parameter 2 to be array, object given in
Thanks.