以下是我的工作代码,但当我试图回应"电信圈"时,得到错误"解析错误:语法错误,意外'圈' (T_STRING)"
if ($_GET['result']):
$rslt = $_GET['result'];
$result = Unirest\Request::get("https://sphirelabs-mobile-number-portability-india-operator-v1.p.mashape.com/index.php?number=$rslt",
array(
"X-Mashape-Key" => "XXXXXXXXXXXXX",
"Accept" => "application/json"
)
);
echo ($result->body->Operator);
echo($result->body->Telecom circle);
endif;
API响应:
{
"Telecom circle": "Delhi NCR",
"Operator": "Vodafone",
"Is MNP": "False"
}
答案 0 :(得分:2)
您的代码应为:
刚刚使用autocomplete="off"
代替<input/>
$result->body->{'Telecom circle'}