Php 在保存字符串时陷入困境
保存字符串时,我会得到一个已编码的字符串 当我保存时:Php 在保存字符串时陷入困境,php,json,string,curl,Php,Json,String,Curl,保存字符串时,我会得到一个已编码的字符串 当我保存时: 'FFFA 我得到: 'FFFA 如何使用ff curl请求保存它们: curl "https://api.adbutler.com/v1/banners/custom-html" \ -H "Authorization: Basic {API_KEY}" \ -H "Content-Type: application/json" \ -X POST \ -d '{ "custom_html": "",
'FFFA
我得到:
'FFFA
如何使用ff curl请求保存它们:
curl "https://api.adbutler.com/v1/banners/custom-html" \
-H "Authorization: Basic {API_KEY}" \
-H "Content-Type: application/json" \
-X POST \
-d '{
"custom_html": "",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "down",
"height": 250,
"html_content_below": "Hello 'world",
"location": "http://www.google.ca",
"name": "Demo Custom HTML' Banner",
"tracking_pixel": "url",
"width": 300
}'
为
CURLOPT_ENCODING
设置另一个curl选项,并将其设置为“”,以确保它不会返回任何垃圾
$location = 'https://api.adbutler.com/v1/banners/custom-html';
$ch = curl_init($location);
curl_setopt($ch, CURLOPT_ENCODING ,"");
你可以试试这个
curl "https://api.adbutler.com/v1/banners/custom-html" \
-H "Authorization: Basic {API_KEY}" \
-H "Content-Type: application/json" \
-X POST \
-d '{
"custom_html": "",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "down",
"height": 250,
"html_content_below": "Hello '\''world",
"location": "http://www.google.ca",
"name": "Demo Custom HTML'\'' Banner",
"tracking_pixel": "url",
"width": 300
}'
有关更多信息,请参见此对每条字符串使用
html\u entity\u decode()
,它似乎不起作用