private function getFileContent($url, $userAgent)
    {
        $opts = [
            'http' => [
                'method' => 'GET',
                'header' => [
                    'User-Agent: '. $userAgent
                ]
            ]
        ];

        $context = stream_context_create($opts);

        return file_get_contents($url, false, $context);
    }
private function getFileContent($url, $userAgent)
    {
        $opts = [
            'http' => [
                'method' => 'GET',
                'header' => [
                    'User-Agent: '. $userAgent
                ]
            ]
        ];

        $context = stream_context_create($opts);

        return file_get_contents($url, false, $context);
    }
private function getFileContent ( $ url , $ userAgent ) { $ opts = [ 'http' => [ 'method' => 'GET' , 'header' => [ 'User-Agent: ' . $ userAgent ] ] ] ; $ context = stream_context_create ( $ opts ) ; return file_get_contents ( $ url , false , $ context ) ; }
A better file_get_contents
A better file_get_contents