我有一个JSON
如下所示的解码数组
array(1) {
[0]=>
object(stdClass)#145 (31) {
["ref_no"]=>
string(15) "28374140183000U"
["meter_msn"]=>
string(12) "002999000172"
["billing_msn"]=>
string(5) "04513"
["latitude"]=>
string(10) "25.5063814"
["longitude"]=>
string(10) "69.0137568"
["tarrif"]=>
string(2) "45"
["s_load"]=>
string(5) "22.38"
["so_person_name"]=>
string(0) ""
["so_phone_number"]=>
string(0) ""
["so_person_designation"]=>
string(0) ""
["customer_id"]=>
string(11) "37010720390"
["istallation_status"]=>
string(9) "Installed"
["site_issues"]=>
string(19) "No hand-over person"
["install_id"]=>
string(26) "28372250046142R_1516705592"
["created_date"]=>
string(19) "2018-23-01 12:00:21"
["consumer_name"]=>
string(52) "T.M.A JHUNDO MARI AT VILL LAKHA DINO CORI S.TOWN MPK"
["consumer_address"]=>
string(52) "T.M.A JHUNDO MARI AT VILL LAKHA DINO CORI S.TOWN MPK"
["comm_status"]=>
string(8) "Verified"
["auth_key"]=>
string(32) "key"
["ct_ratio"]=>
string(3) "200"
["ct_ratio_quantity"]=>
string(1) "4"
["cable_type"]=>
string(5) "19/83"
["cable_length"]=>
string(3) "4.2"
["atb_installed"]=>
string(3) "Yes"
["meter_type"]=>
string(7) "L.T.TOU"
["old_meter_power"]=>
string(1) "5"
["old_meter_reactive_power"]=>
string(1) "3"
["new_meter_power"]=>
string(1) "2"
["new_meter_reactive_power"]=>
string(1) "3"
["site_images_name"]=>
array(0) {
}
["doc_images_name"]=>
array(0) {
}}}
从这个输出我想得到meter_msn
. JSON
响应在一个文件中,我正在获取文件的内容,如下所示
$fp = fopen('debugeeeeeee.txt', 'w+');
fwrite($fp, file_get_contents('php://input'));
fclose($fp);
$inputs = json_decode(file_get_contents('php://input'));
现在取出meter_msn
我已经尝试过$inputs->meter_msn
这给了我unidentified error
并且inputs['meter_msn']
给了我Undefined index: meter_msn
错误。
我搜索了很多关于它的文章和问题,并尝试了所有解决方案,但仍然无法得到结果。我怎么才能得到它 ?
任何帮助将不胜感激。