2

I am developing a Facebook Application in which I need to view the user_work_history data of a profile. Im doing this in PHP, and Facebook's Documentation is very cryptic and terrible.

In the documentation (http://developers.facebook.com/docs/reference/api/user/), it says "An array of JSON objects containing employer, location, position, start_date and end_date fields". I assumed I would access this by doing something along the lines of <?php echo $me[work]; ?> however that only returns "array" in the output.

I've tried various things such as <?php echo $me[work][employer]; ?> which didn't work either.

Any help would be appreciated and recognized!

1 Answer 1

2

Try doing a var_dump($me['work']) or whatever to get a clearer look into what's inside that variable.

Additionally, you can get your access token by calling $fb_object->getAccessToken(); and use that in this URL: https://graph.facebook.com/me?access_token=<whatever>. Navigating to that in your browser will show you what data is coming back so you can get a better idea of the formatting.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you Jimmy! That seems to have worked, I'll just need to figure out how to parse the data to get a specific string and I'll be set! I'll "accept" this answer as soon as Stackoverflow will let me :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.