我有一个特定ID号的令牌,它是494。
$url = api.pipedrive.com/v1/deals/494/products?start=0&api_token=7ecb71622dadd2faae2732bfe73b09381150c967;我想把号码494改为任意号码。
一开始我做了一个不合逻辑的代码。
有关于如何做到这一点的指南吗?
$url = "https://api.pipedrive.com/v1/deals/";
$id = 494;
$api = "/products?start=0&api_token=7ecb71622dadd2faae2732bfe73b09381150c967";
$response = file_get_contents($url+$id+$api);
echo $response;
$object = json_decode($response, true);我拿到了errorL
警告: file_get_contents(494):未能打开流:没有这样的文件或目录
发布于 2016-10-02 15:11:31
您正在使用“+”运算符连接。两个变量之和。您需要使用级联操作符('.')不是“+”
$url = $url.$id.$api;发布于 2016-10-02 15:22:16
在PHP中,.用于字符串连接。此外,还可以使用.=将字符串附加到字符串变量。示例:
$str = "Hello";
$str2 = $str . "Anthea"; // $str2 = "Hello Anthea"或
$str = "Hello";
$str .= "Anthea"; // $str = "Hello Anthea"https://stackoverflow.com/questions/39818340
复制相似问题