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

  • SEARCH
  • Home
  • 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 6106031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:02:10+00:00 2026-05-23T14:02:10+00:00

{ http://url.com: { id: http://url.com, shares: 11111 } } I need to access ‘id’

  • 0
{
   "http://url.com": {
      "id": "http://url.com",
      "shares": 11111
   }
}

I need to access ‘id’ and ‘shares’ and seems like the normal

($results->shares)

doesn’t work here, any suggestions? thanks.

EDIT with full code:

<?php 

include __DIR__ . '/config.php';

function do_curl($start_index, $stop_index) {

    // Do query here to get all pages with ids between start index and stop index

$sql = "SELECT * FROM mmakers WHERE id >= $start_index and id <= $stop_index";
$result = mysql_query($sql) or die(mysql_error());
    while ($row = mysql_fetch_array($result))
    {
        $fanpages_query[] = 'https://graph.facebook.com/?ids='.$row['domain'];
    }
    return $fanpages_query;

}


$fanpages = do_curl($_GET['start_index'], $_GET['stop_index']);
$fanpages_count = count($fanpages);


$curl_arr = array();
$master = curl_multi_init();

for($i = 0; $i < $fanpages_count; $i++)
{
    $url = $fanpages[$i];
    $curl_arr[$i] = curl_init($url);
    curl_setopt($curl_arr[$i], CURLOPT_RETURNTRANSFER, true);
    curl_multi_add_handle($master, $curl_arr[$i]);
}
do {
    curl_multi_exec($master,$running);
} while($running > 0);


for($i = 0; $i < $fanpages_count; $i++)
{
    $results = json_decode(curl_multi_getcontent($curl_arr[$i]));

    $sql_mm = "SELECT * FROM mmakers WHERE domain='".($results->id)."'";
    $result_mm = mysql_query($sql_mm) or die(mysql_error());
    $row_mm = mysql_fetch_array($result_mm);

    if ($row_mm['type'] == 'auto') {
    $sql_d = "SELECT domain FROM domains_list WHERE used='no' AND directory='".$row_mm['directory']."' AND type='auto' ORDER BY rand() LIMIT 1";
    $result_d = mysql_query($sql_d) or die(mysql_error());
    $row_d = mysql_fetch_array($result_d);
    } else {
    $sql_d = "SELECT domain FROM domains_list WHERE used='no' AND directory='".$row_mm['directory']."' AND type='jaa' ORDER BY rand() LIMIT 1";
    $result_d = mysql_query($sql_d) or die(mysql_error());
    $row_d = mysql_fetch_array($result_d);
    }

    mysql_query("UPDATE mmakers SET shares = '".($results->shares)."' WHERE id='".$row_mm['id']."'") or die(mysql_error());

}

?>
  • 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-23T14:02:10+00:00Added an answer on May 23, 2026 at 2:02 pm

    I suggest to decode the JSON as an array:

    $results = json_decode($json, true);
    

    Then assuming you don’t know the URL, you have to loop over the array:

    foreach($results as $url => $data) {
        echo $url, ' shares: ', $data['shares'];
    }
    

    If you know the URL, you can do

    $results['http://url.com']['shares'];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the URL I want to share: http://mydomain.com/#url=http://stackoverflow.com Inside my site, I do
I found the following code to create a tinyurl.com url: http://tinyurl.com/api-create.php?url=http://myurl.com This will automatically
Given the following url: http://foo.com?bar=1&wee=2 What is the quickest way to get the raw
URL url = new URL(http://twitter.com/statuses/update.xml); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); String cridentials =
Is this a valid http url http://www.example.com?x&y or we must always have = sign
Say I'm at the url http://mysite.com/form.html . When viewing source, I see <form method=post
I have done urlencode of the variable before passing to the URL http://example.com/Restaurants?alias=F%26B But
I'm working with code igniter and for some reason, the url http://mysite.com/account/100 gives me
Given: Url - http://www.contoso.com/search.php?q= {param} returns: -html- --body- {...} ---div id='foo'- ----div id='page1'/- ----div
URL url = new URL(http://www.example.com/comment); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoOutput(true); connection.setRequestMethod(POST); Is connection.setRequestProperty(key,

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.