T
T
t0nsofdamage2017-05-15 17:27:46
PHP
t0nsofdamage, 2017-05-15 17:27:46

How to configure encoding when parsing with guzzle?

I'm trying to figure out the Guzzle HTTP client. At the output I get a downed encoding.
Tell me, what did I miss?

$client = new \GuzzleHttp\Client([
    'base_uri' => 'http://pikabu.ru/'
]);

$response = $client->request('GET')->getBody()->getContents();

echo $response;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andy Developer, 2017-05-15
@t0nsofdamage

$result = iconv("windows-1251","utf-8",$result)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question