Search code examples
instagraminstagram-api

instagram API :find user id from comment id


i find comment id from my image

$comment= $instagram->getMediaComments($id_photo);

in $comment i have :

 array (size=3)
      0 => 
        object(stdClass)[317]
          public 'created_time' => string '1428490039' (length=10)
          public 'text' => string 'Keye?😋kojast?' (length=16)
          public 'from' => 
            object(stdClass)[318]
              ...
          public 'id' => string '958566383632997763' (length=18)

i have comment id but i want find user id!


Solution

  • The element from of the array should contain the user id that you are searching for, so you should be able to get it like this:

    $comment[0]->from->id