How can I get html webpage charset encode from html as string and not as dom?
I get html string like that:
$html = file_get_contents($url);
preg_match_all (string pattern, string subject, array matches, int flags)
but i dont know regex, and I need to find out webpage charset (UTF-8/windows-255/etc..)
Thanks,
preg_match(‘~charset=([-a-z0-9_]+)~i’,$html,$charset);