I am trying to grab the HTML from the below page using some simple php.
URL: https://kat.cr/usearch/architecture%20category%3Abooks/
My code is:
$html = file_get_contents('https://kat.cr/usearch/architecture%20category%3Abooks/');
echo $html;
where file_get_contents
works, but returns scrambled data:
I have tried using cUrl
as well as various functions like: htmlentities(),
mb_convert_encoding
, utf8_encode
and so on, but just get different variations of the scrambled text.
The source of the page says it is charset=utf-8
, but I am not sure what the problem is.
Calling file_get_contents()
on the base url kat.cr
returns the same mess.
What am I missing here?