PHP ::単純なhtmldomパーサー(utf-8、windows-255など)を使用してWebページの文字セット値を取得するにはどうすればよいですか?
備考:htmldomパーサーhttp://simplehtmldom.sourceforge.netで実行する必要があります
例1のWebページの文字セット入力:
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
結果:utf-8
Example2 Webページの文字セット入力:
<meta content="text/html; charset=windows-255" http-equiv="Content-Type">
結果:windows-255
編集:
私はこれを試します(しかし、それは機能しません):
$html = file_get_html('http://www.google.com/');
$el=$html->find('meta[content]',0);
echo $el->charset;
何を変えるべきですか?($ el-> charsetが機能しないことを知っています)
ありがとう