PHP code example of sasezaki / diggin-guzzle4-charset-subscriber
1. Go to this page and download the library: Download sasezaki/diggin-guzzle4-charset-subscriber library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sasezaki / diggin-guzzle4-charset-subscriber example snippets
php
use GuzzleHttp\Client;
use DigginGuzzle4CharsetSubscriber\CharsetSubscriber;
etEmitter()->attach(new CharsetSubscriber);
$res = $client->get($url);
var_dump(strip_tags($res->getBody()->__toString())); // will be output as UTF-8