This script first tries to find the meta tags including the description, title and keywords of a web page and if it does not get any, it will extract the content using the Curl library and the iconv function which takes into consideration the different charset. There is a live demo.