How to get the charset from HTML code with SimpleHTML Dom
By including the Simple HTML Dom library you can extract any HTML element and get their attributes. This is how to get the charset from the meta tag element. The function _get_html_charset() will return "utf-8".