How could you die without opening the JSON data Ah _ (: З"∠) _

Source: Internet
Author: User
http://202.103.244.125/catst.php
As above, just contact PHP was so anxious! Json_decode out of the Forever is NULL AH!!! Online methods have been tried, ask God to help


Reply to discussion (solution)

I don't believe you've tried.

$url = ' http://202.103.244.125/catst.php '; $s = file_get_contents ($url);p Rint_r (Json_decode (substr ($s, 3));
Array ([0] = StdClass Object ([menutype] = A [GROUPX] = 0 [Titleng [Titlech] = Cold Dish) [1] = = StdClass Object ([Menutype] =&gt ; A [GROUPX] + 1 [titleng] = soup porridge [Titlech] = Soup PORRDG) [2] = =            StdClass Object ([menutype] = A [GROUPX] + 2 [Titleng] + hot Dishes [Titlech] = hot food) [3] = = StdClass Object ([menutype] = A [groupx        ] = 3 [Titleng] = vegetarian [Titlech] = veget-able) [4] = = StdClass Object ([Menutype] + A [GROUPX] = 4 [Titleng] [Titlech] = Mai            n food) [5] = = StdClass Object ([menutype] = A [GROUPX] = 5 [Titleng] = grilled fish beerFish [Titlech] and grilled fish beer fish) [6] = = StdClass Object ([menutype] = A [GROUPX] = 6 [Titleng] = dry pot saucepan [Titlech] = Gangou hotpot) [7] = Stdclas S Object ([menutype] = A [GROUPX] = 7 [Titleng] = iron casserole [t Itlech] = Sheet hotpot) [8] = = StdClass Object ([menutype] = A [groupx            ] = 8 [Titleng] = Sand pot [Titlech] = Sha Guo) [9] = = StdClass Object (     [Menutype] + A [GROUPX] + 9 [Titleng] = [Titlech] = =) [Ten] = StdClass Object ([menutype] = A [GROUPX] = [Titleng] =& Gt Special Recommendations [Titlech] = special food) [one] = StdClass Object ([menutype] = A [GROUPX] = [Titleng] = 18 brew [Titlech] = 18 brew) [] = StdClass Object (  [Menutype] + A [GROUPX] [Titleng] = drink Tea [Titlech] = Drink            TEA) [+] = StdClass Object ([menutype] = A [GROUPX] + 13 [Titleng] = other custom [Titlech] and other customizations) [+] = StdClass Object ([Menu  Type] = A [GROUPX] = [Titleng] = Liquor beer [Titlech] = wine Beer))

Get a BOM head and kill yourself.

http://202.103.244.125/catst.php
As above, just contact PHP was so anxious! Json_decode out of the Forever is NULL AH!!! Online methods have been tried, ask God to help


Positive solution

I don't believe you've tried.

$url = ' http://202.103.244.125/catst.php '; $s = file_get_contents ($url);p Rint_r (Json_decode (substr ($s, 3));
Array ([0] = StdClass Object ([menutype] = A [GROUPX] = 0 [Titleng [Titlech] = Cold Dish) [1] = = StdClass Object ([Menutype] =&gt ; A [GROUPX] + 1 [titleng] = soup porridge [Titlech] = Soup PORRDG) [2] = =            StdClass Object ([menutype] = A [GROUPX] + 2 [Titleng] + hot Dishes [Titlech] = hot food) [3] = = StdClass Object ([menutype] = A [groupx        ] = 3 [Titleng] = vegetarian [Titlech] = veget-able) [4] = = StdClass Object ([Menutype] + A [GROUPX] = 4 [Titleng] [Titlech] = Mai            n food) [5] = = StdClass Object ([menutype] = A [GROUPX] = 5 [Titleng] = grilled fish beerFish [Titlech] and grilled fish beer fish) [6] = = StdClass Object ([menutype] = A [GROUPX] = 6 [Titleng] = dry pot saucepan [Titlech] = Gangou hotpot) [7] = Stdclas S Object ([menutype] = A [GROUPX] = 7 [Titleng] = iron casserole [t Itlech] = Sheet hotpot) [8] = = StdClass Object ([menutype] = A [groupx            ] = 8 [Titleng] = Sand pot [Titlech] = Sha Guo) [9] = = StdClass Object (     [Menutype] + A [GROUPX] + 9 [Titleng] = [Titlech] = =) [Ten] = StdClass Object ([menutype] = A [GROUPX] = [Titleng] =& Gt Special Recommendations [Titlech] = special food) [one] = StdClass Object ([menutype] = A [GROUPX] = [Titleng] = 18 brew [Titlech] = 18 brew) [] = StdClass Object (  [Menutype] + A [GROUPX] [Titleng] = drink Tea [Titlech] = Drink            TEA) [+] = StdClass Object ([menutype] = A [GROUPX] + 13 [Titleng] = other custom [Titlech] and other customizations) [+] = StdClass Object ([Menu  Type] = A [GROUPX] = [Titleng] = Liquor beer [Titlech] = wine Beer))

It seems to be really OK!!!
Excuse me, what is the parameter of the substr () 3? Is it 3 to process other JSON files? Or do we need to make a decision?

Utf-8 BOM Header, is three characters, so skip the first 3 characters with substr
Since it is to output JSON then program files to be saved as utf-8 no BOM format

Thank you Moderator!!

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.