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? Quote Link to comment 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>. Quote Link to comment 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.