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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:10:57+00:00 2026-06-17T12:10:57+00:00

When I put a URL in browser, I get the output (bellow) {categories:[{id:16,name:Arm Locks},{id:555,name:Articles},{id:19,name:Back

  • 0

When I put a URL in browser, I get the output (bellow)

{"categories":[{"id":"16","name":"Arm Locks"},{"id":"555","name":"Articles"},{"id":"19","name":"Back Control"},{"id":"21","name":"Brazilian Jiu Jitsu"},{"id":"12","name":"Chokes"},{"id":"15","name":"Crank"},{"id":"14","name":"Escapes"},{"id":"554","name":"Grappling Videos"},{"id":"10","name":"Guard and Rubber Guard"},{"id":"13","name":"Guard Breaks"},{"id":"23","name":"Half Guard"},{"id":"26","name":"Japanese Jujutsu"},{"id":"1","name":"Jiu Jitsu Training"},{"id":"5","name":"Jiu Jitsu Videos"},{"id":"25","name":"Leg Locks"},{"id":"27","name":"MMA"},{"id":"17","name":"Mount"},{"id":"30","name":"North South Position"},{"id":"556","name":"Platinum Members Only"},{"id":"29","name":"Self Defense"},{"id":"18","name":"Side Control"},{"id":"28","name":"Strikes"},{"id":"11","name":"Sweeps"},{"id":"20","name":"Theory & Discussions"},{"id":"9","name":"Throws"},{"id":"31","name":"Wrestling"},{"id":"22","name":"Wrist Locks"}]}

But when I try to parse using PHP (PHP Code and output)

PHP Code

<?php
$url = "https://domain.com/apis/cats.php?type=json";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$json = curl_exec($ch);
$dcjsn = json_decode($json);

foreach ($dcjsn->categories as $cat){
    echo $cat->id;
    echo "<br>";
}

And output is:

555
15
14
554
13
23
26
25
27
17
30
29
18
28
20
9
22

Mean about 10 items missing!

I failed to identify the error in my code. I’ve tried with file_get_contents() also but no luck.

Addition:

result of var_dump($json)

string(574) "{"categories":[{"id":"555","name":"Articles"},{"id":"15","name":"Crank"},{"id":"14","name":"Escapes"},{"id":"554","name":"Grappling Videos"},{"id":"13","name":"Guard Breaks"},{"id":"23","name":"Half Guard"},{"id":"26","name":"Japanese Jujutsu"},{"id":"25","name":"Leg Locks"},{"id":"27","name":"MMA"},{"id":"17","name":"Mount"},{"id":"30","name":"North South Position"},{"id":"29","name":"Self Defense"},{"id":"18","name":"Side Control"},{"id":"28","name":"Strikes"},{"id":"20","name":"Theory & Discussions"},{"id":"9","name":"Throws"},{"id":"22","name":"Wrist Locks"}]}"
  • 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-06-17T12:10:58+00:00Added an answer on June 17, 2026 at 12:10 pm

    It seems that the API you’re requesting requires authentication, and you’re not logged in from the PHP code, while you are in the browser.

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

Sidebar

Related Questions

I am using mod_rewrite to put a category name in the URL, like locahost/categoryName
I put those two above. But I get no intellisense with jquery. <script src=@Url.Content(~/Scripts/jquery-ui-1.8.11.js)
I put url to browser's address bar and it downloads the zip file to
When I put background-image: url() in to .css , browser doesnt put that image
I understand that GET is typically associated with a URL where you can put
I have a working .Net WCF HTTP service. If I put the URL into
I want to allow users to put in am img url instead of uploading
I've tried WebSphinx application. I realize if I put wikipedia.org as the starting URL,
I am able to get the reviews iframe url from Amazon::AWS::ItemSearch but I'm having
I have tried many methods to try and get the contents of a url,

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.