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 5844109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:14:49+00:00 2026-05-22T12:14:49+00:00

I am creating a php script to check if a person is following me

  • 0

I am creating a php script to check if a person is following me on Twitter and I am using the REST API Method: friendships show method and using themattHarris tmhOAuth library for OAuth.

I am making the request using the following code:

$code=$tmhOAuth->request('GET', $tmhOAuth->url('friendships/show'), array( 'target_screen_name' => 'bob' ));

if ($code==200){  $code = json_decode($tmhOAuth->response['response'], true); }

The request is successful and returns similar json output as shown on the apiwiki page:

{"relationship": { "source": { "id": 123, "screen_name": "bob", "following": true, "followed_by": false, "notifications_enabled": false }, "target": { "id": 456, "screen_name": "jack", "following": false, "followed_by": true, "notifications_enabled": null } } }

MY QUESTION

How do I extract the following value from the array returned?

"id": 456,
  • 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-22T12:14:50+00:00Added an answer on May 22, 2026 at 12:14 pm
    $code['relationship']['target']['id']
    

    Look at example: http://codepad.org/KMEP5wPW

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a process using proc_open in one PHP script. How do i
I am creating an image via a php script using imagepng. This works fine
I am creating thumbnails of fixed height and width from my PHP script using
I am creating a php backup script that will dump everything from a database
I am creating a poll script for a facebook fan page: http://www.facebook.com/apps/application.php?id=115400635147687&v=app_115400635147687 I am
I'm using this php class ( http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php ) for creating the different sized images
I am creating a php script that would be called as a cron job.
I'm using PHP, Oracle and crontab. Crontab is invoking a php script, which is
I'm creating a PHP script that fetches IDs from a database. The results are
I am creating a php script to post some information on a fan page

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.