Using PHP, how to parse the header and meta tags from an HTML page?

Possible duplicate:
CodeIgniter: class / library to help get meta tags from a web page?

I need to get the TITLE and DESCIPTION metadata on the page.

I tried to do this, but I was getting more errors than the actual results. (I have an array of about 10 URLs, usually only about 2 of them give me a description. I still need to get the header).

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

-Dylan

+3
source share
1 answer

- cURL ( , , HTTP - 200), , HTML DOM, . (, )

+1

Source: https://habr.com/ru/post/1748872/


All Articles