Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6148879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:21:21+00:00 2026-05-23T19:21:21+00:00

I have been playing around with Facial recognition in PHP via the face.com API.

  • 0

I have been playing around with Facial recognition in PHP via the face.com API. I am able to compare an image with a namespace and get the data returned to me in what I think is a JSON string. The problem is, I’m having trouble parsing it. Here is my code:

<?php

require_once("FaceRestClient.php");

$apikey = "API";
$apisecret = "SECRET";

$im1 = "http://zbrowntechnology.com/social1/20110718014242.jpg";

$api = new FaceRestClient($apikey, $apisecret);

$result = $api->faces_recognize(array($im1), "all@zach42047");

?>

Result returns the following data, but only when I use var_dump($result); :

object(stdClass)#2 (3) { ["photos"]=> array(1) { [0]=> object(stdClass)#3 (5) { ["url"]=> string(54) "http://zbrowntechnology.com/social1/20110718014242.jpg" ["pid"]=> string(67) "F@5a0af17100c8d0d3bb018bf2e10c840f_b5a43c71a66cc5f474c7eaf4927b93b1" ["width"]=> int(320) ["height"]=> int(240) ["tags"]=> array(1) { [0]=> object(stdClass)#4 (25) { ["tid"]=> string(88) "TEMP_F@5a0af17100c8d0d3bb018bf2e10c840f_b5a43c71a66cc5f474c7eaf4927b93b1_54.06_42.08_1_0" ["recognizable"]=> bool(true) ["threshold"]=> int(65) ["uids"]=> array(1) { [0]=> object(stdClass)#5 (2) { ["uid"]=> string(19) "ZachBrown@zach42047" ["confidence"]=> int(98) } } ["gid"]=> NULL ["label"]=> string(0) "" ["confirmed"]=> bool(false) ["manual"]=> bool(false) ["tagger_id"]=> NULL ["width"]=> float(39.38) ["height"]=> float(52.5) ["center"]=> object(stdClass)#6 (2) { ["x"]=> float(54.06) ["y"]=> float(42.08) } ["eye_left"]=> object(stdClass)#7 (2) { ["x"]=> int(45) ["y"]=> float(29.73) } ["eye_right"]=> object(stdClass)#8 (2) { ["x"]=> float(65.73) ["y"]=> float(29.86) } ["mouth_left"]=> object(stdClass)#9 (2) { ["x"]=> float(48.33) ["y"]=> float(55.14) } ["mouth_center"]=> object(stdClass)#10 (2) { ["x"]=> float(56.66) ["y"]=> float(55.97) } ["mouth_right"]=> object(stdClass)#11 (2) { ["x"]=> float(63.53) ["y"]=> float(54.29) } ["nose"]=> object(stdClass)#12 (2) { ["x"]=> float(57.52) ["y"]=> float(46.32) } ["ear_left"]=> NULL ["ear_right"]=> NULL ["chin"]=> NULL ["yaw"]=> float(14.15) ["roll"]=> float(0.26) ["pitch"]=> float(-3.41) ["attributes"]=> object(stdClass)#13 (4) { ["face"]=> object(stdClass)#14 (2) { ["value"]=> string(4) "true" ["confidence"]=> int(63) } ["gender"]=> object(stdClass)#15 (2) { ["value"]=> string(4) "male" ["confidence"]=> int(48) } ["glasses"]=> object(stdClass)#16 (2) { ["value"]=> string(5) "false" ["confidence"]=> int(12) } ["smiling"]=> object(stdClass)#17 (2) { ["value"]=> string(5) "false" ["confidence"]=> int(96) } } } } } } ["status"]=> string(7) "success" ["usage"]=> object(stdClass)#18 (5) { ["used"]=> int(0) ["remaining"]=> int(5000) ["limit"]=> int(5000) ["reset_time_text"]=> string(31) "Mon, 18 Jul 2011 11:38:26 +0000" ["reset_time"]=> int(1310989106) } }

I need to get the uid and confidence data.

I have been researching this for hours, since 11 last night (6 am now).That is how I am able to get the data returned. I tried using JSON to decode, but I still couldn’t get the data I needed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:21:23+00:00Added an answer on May 23, 2026 at 7:21 pm
    foreach($result->photos as $photo) {
        foreach($photo->tags as $tag) {
            foreach($tag->uids as $uid) {
                echo $uid->uid . ' ' . $uid->confidence;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I saw a post earlier today and have been playing around with: http://arashkarimzadeh.com/index.php/jquery/7-editable-jquery-plugin.html What
I am new to OAuth and have been playing around with the Twitter API.
I have been playing around with these CSS3 properties and I've been able to
I have been playing around with the postgresql.conf file for a couple days now.
I have been playing around with the EF to see what it can handle.
I have been working with PostgreSQL, playing around with Wikipedia's millions of hyperlinks and
Have been playing around with linq but there is one thing I cant seem
I have been playing around with writing some simple card games in Python for
I have been playing around in expect recently and I for the life of
I have been playing around with a search control and i have noticed that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.