url - PHP cURL - ★ symbol? -
i need json bitskins, create code. (below) code works urls, have problem url:
https://bitskins.com/api/v1/get_price_data_for_items_on_sale/?api_key=xxx&code=xxx&names=★ bayonet,★ bayonet | blue steel (battle-scarred),★ bayonet | blue steel (factory new)
my code:
$url = urlencode('https://bitskins.com/api/v1/get_price_data_for_items_on_sale/?api_key=xxx&code=' . $totp . '&names=' . $string); $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_useragent, 'mozilla/5.0 (windows nt 6.1) applewebkit/537.36 (khtml, gecko) chrome/41.0.2228.0 safari/537.36'); curl_setopt($ch, curlopt_followlocation, 1); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_returntransfer, 1); $output = curl_exec($ch); $output = json_decode($output, true);
i tried without urlencode(), still nothing. symbol ★ or comma in url? (in browser url works well)
thank much!
you wouldn't want encode entire url, rather query string values themselves.
e.g.
$url = 'https://bitskins.com/api/v1/get_price_data_for_items_on_sale/' .'?api_key=xxx&code=' . $totp . '&names=' . urlencode($string);
tested , works on site.
Comments
Post a Comment