Andarian Posted November 14, 2007 Share Posted November 14, 2007 Hey everyone! Been programming with PHP for a while but still lack some basics. I'm using file() to crawl websites and get their content. But when receiving the content I've no way to find out what is the charset of the content. Is that stored in some var somewhere? or is there some way to figure it out? Link to comment https://forums.phpfreaks.com/topic/77284-solved-my-first-question-here-about-getting-charset-info/ Share on other sites More sharing options...
trq Posted November 14, 2007 Share Posted November 14, 2007 If its well formed html your scraping, it should be defined within the <head>. Link to comment https://forums.phpfreaks.com/topic/77284-solved-my-first-question-here-about-getting-charset-info/#findComment-391280 Share on other sites More sharing options...
Andarian Posted November 14, 2007 Author Share Posted November 14, 2007 doh.. stupid me I knew there was something basic I'm forggeting. so I need a to search for something like content="text/html; charset=ISO-8859-1" in the content and i'm good... thanks! Link to comment https://forums.phpfreaks.com/topic/77284-solved-my-first-question-here-about-getting-charset-info/#findComment-391282 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.