I am trying to send an http request from my server to another server in php. The url that I send the request to contains some utf8 characters for example http://www.aparat.com/etc/api/videoBySearch/text/نوروز .
Here is my code:
const api_adress = 'http://www.aparat.com/etc/api/';
const xml_config = 'http://www.aparat.com/video/video/config/videohash/[ID]/watchtype/site';
public function getDataInArray($JSON_ADRESS)
{
$json = json_decode(file_get_contents(self::api_adress . utf8_encode($JSON_ADRESS)), true);
return ($json != NULL) ? $json : die(NULL);
}
I have also tried php-curl insted of file-get-contents but I got no answer.