K
K
kapai692015-03-02 12:45:27
PHP
kapai69, 2015-03-02 12:45:27

Curl returns "ï"¿, how to fix?

It is clear that this is utf-8 with a bom, but only these three characters come in, for some reason the content is not loaded.
Curl I have

$curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, "http://site.ru/page.html");
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
        curl_setopt($curl, CURLOPT_FAILONERROR, true);
        curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
        $content = curl_exec($curl);
        curl_close($curl);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kapai69, 2015-03-02
@kapai69

It's decided, you need to add an option
and everything will work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question