PHP - 这些是什么以及如何回显某些值?

时间:2016-06-06 13:53:54

标签: php variables web

我希望创建一个基本的IP跟踪器,我试图弄清楚如何回应这个变量的某些方面,欢呼:

</template>
<script>
TodoPopup = Polymer({
        is : 'todo-popup' ,
        behaviors : [Polymer.IronOverlayBehavior]
    });
</script>

这是我正在阅读的代码:

{"ip":"MY IP","country_code":"GB","country_name":"United Kingdom","region_code":"ENG","region_name":"England","city":"MY CITY","zip_code":"MY CODE","time_zone":"Europe/London","latitude":----,"longitude":-----,"metro_code":-}

}

干杯!

1 个答案:

答案 0 :(得分:3)

回应一些事情

//Example
      $locationObject = json_decode($location);
      echo $locationObject->ip; 
//Prints out: 77.99.179.98 

更多信息 http://www.dyn-web.com/tutorials/php-js/json/decode.php