2017-06-05 46 views
0

我節省了串 時得到一個編碼字符串,當我保存:陷入挽救一個字符串

'FFFA 

我得到:

'FFFA 

我怎麼能救他們使用FF捲曲請求:

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 
    }' 
+1

使用'html_entity_decode()'爲每個字符串 –

+0

它似乎沒有工作 – Viscocent

回答

0

組爲CURLOPT_ENCODING另一個捲曲選項並將其設置爲「」,以確保它瓦特生病不返回任何垃圾

 $location = 'https://api.adbutler.com/v1/banners/custom-html'; 
$ch = curl_init($location); 
     curl_setopt($ch, CURLOPT_ENCODING ,""); 
0

你可以試試這個

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 
}' 

看到這個link更多信息

相關問題