简体   繁体   English

无法检索Json信息

[英]Unable to retrieve Json Information

Trying to retrieve a JSON array however the page is just echoing "Null" 尝试检索JSON数组,但是页面仅回显“ Null”

Here is the code that I use to retrieve the Json Variable 这是我用来检索Json变量的代码

    <?php
function getSystem($address)

    {

        $data_location = "/r10database/checkSystem/index.php?theaddress=".$address;
        $data = file_get_contents($data_location);


        $data = json_decode($data);

        $system = $data->system;

        var_dump($system);



    }
getSystem("Blvd");
?>

And here is my code to encode my json variable 这是我的代码来编码我的json变量

function changeElement(contentString,address){


var addressObject = new Array();
addressObject[0]=contentString;

var json_str = JSON.stringify(addressObject); 
var obj = JSON.parse(json_str)

  $('#insertHere').html(json_str);

}

The remote API is broken. 远程API损坏。

http://pear.coreyjansen.com/r10database/checkSystem/index.php?theaddress=200%20Scurfield%20Blvd http://pear.coreyjansen.com/r10database/checkSystem/index.php?theaddress=200%20Scurfield%20Blvd

Resource interpreted as Script but transferred with MIME type text/plain: "http://geoxml3.googlecode.com/svn/branches/polys/geoxml3.js". index.php:11
Uncaught SyntaxError: Unexpected token else index.php:116
Uncaught ReferenceError: initialize is not defined index.php?theaddress=200%20Scurfield%20Blvd:132

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM