响应卷曲为空

时间:2018-09-18 07:45:30

标签: php curl

响应为NULL。这是我的代码:

$url = "http://www.localhost:81/dbWIP/selectApi.php?name='$name'";
$client = curl_init();
echo $client;
curl_setopt($client, CURLOPT_URL,$url);
curl_setopt($client,CURLOPT_RETURNTRANSFER,true);
curl_setopt($client, CURLOPT_HEADER, false);
$response = curl_exec($client);
curl_close($client);
$result = json_decode($response);
echo $response;

1 个答案:

答案 0 :(得分:1)

$ name var无法正确显示,请尝试以下操作:

<shape-holder>
  <circle>
    Custom Circle content
  </circle>
  <line>
    Custom Line content
  </line>
</shape-holder>

现在它只是显示:

  

$ url =“ http://www.localhost:81/dbWIP/selectApi.php?name='$ name'”;