PHP gets the JSON data through the URL and returns a null value

Source: Internet
Author: User
http://php.net/api/apply.php?&apply={"Apply": {"name": "4747474", "Site": "http:\/\/4444444444444444", "icon": " "Information": "474", "about": "747", "Weibo": "74444444444", "email": "74444444444444444", "Moblie": "89742589633" , "Isfree": "Y", "Applytime": 1349939108}}

This is a link, I on this page how to put the JSON format to come out?


Reply to discussion (solution)

$x = Json_decode ($_get[' Apply ');

$x = Json_decode ($_get[' Apply ');


It's still empty, maybe there's something wrong with that string ...

Var_dump (Json_decode ($_get[' Apply '],true));
Look what?

Var_dump (Json_decode ($_get[' Apply '],true));
Look what?


Null

Var_dump (Json_decode (urldecode ($_get[' Apply '), true));

Var_dump (Json_decode (urldecode ($_get[' Apply '), true));



Also can't, finally I put those redundant \ Remove, do not know why AH?

Print_r (' {' "apply": {"name": "4747474", "Site": "http:\/\/4444444444444444", "icon": "Json_decode", "Information": " 474 "," about ":" 747 "," Weibo ":" 74444444444 "," email ":" 74444444444444444 "," Moblie ":" 89742589633 "," Isfree ":" Y "," Applytime ": 1349939108}} ');
StdClass object (    [Apply] = StdClass Object        (            [name] = 4747474            [site] =/http 4444444444444444 [            icon] = [            Information] = 474            [about] = 747            [Weibo] + 74444444444            [email] = 74444444444444444            [Moblie] = 89742589633            [Isfree] = y            [applytime] = 1349939108        ))

PHP Code
Print_r (' {' "apply": {"name": "4747474", "Site": "http:\/\/4444444444444444", "icon": "Json_decode", "Information": " 474 "," about ":" 747 "," Weibo ":" 74444444444 "," email ":" 74444444444444444 "," Moblie ":" ...



Yes, thank you.

LZ address parameters apply front more than A & symbol, you see whether this is the problem

I had a problem with my text format before, and I got the wrong result.

$json _string = $_get["Apply"];
if (Ini_get ("magic_quotes_gpc") = = "1")
{
$json _string=stripslashes ($json _string);
}

  • 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.