butteff
butteff

Reputation: 127

file_get_contents() PHP

Why have I got trouble with charset on echo?

$url = "http://ru.wikipedia.org";
$site=file_get_contents($url);
echo $site;

Upvotes: 0

Views: 3115

Answers (1)

soulmerge
soulmerge

Reputation: 75704

Try putting header('Content-Type: text/html;charset=utf-8'); at the start of your file

Upvotes: 3

Related Questions