Using PHP, how to parse the title and meta tags from a HTML page?

Posted by Dylan Taylor on Stack Overflow See other posts from Stack Overflow or by Dylan Taylor
Published on 2010-06-07T16:08:21Z Indexed on 2010/06/07 16:12 UTC
Read the original article Hit count: 405

Filed under:
|
|
|

Hey guys,

I need to be able to get the TITLE and DESCIPTION metadata out of a page.

I've been trying to do this but I've been getting more errors than actual results. (I have an array of about 10 URLS, usually only about 2 of them give me the descrption. I have yet to get the title).

So how do I, in PHP, get the Desc and Title from a remote page, and if there is none or if there's an error, ignore it?

-Dylan

© Stack Overflow or respective owner

Related posts about php

Related posts about web