# \[PHP\] How to extract a html tag from distant site

**URL:** <https://forum.kirupa.com/t/php-how-to-extract-a-html-tag-from-distant-site/146284>\
**Category:** Uncategorized\
**Created:** [April 29, 2005, 5:30pm UTC](https://forum.kirupa.com/t/php-how-to-extract-a-html-tag-from-distant-site/146284 "2005-04-29T17:30:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flashmatazz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/flashmatazz/32/140_2.png) [@Flashmatazz](https://forum.kirupa.com/u/Flashmatazz)\
**Post date:** [April 29, 2005, 5:30pm UTC](https://forum.kirupa.com/t/php-how-to-extract-a-html-tag-from-distant-site/146284/1 "2005-04-29T17:30:39Z")

</div>

How would I go about when I want to use PHP for searching for a specific tag in a site’s homepage? I’d like to search for something like this:

```php

<link rel="alternate" type="application/rss+xml" title="kirupa.com Updates" href="http://www.kirupa.com/modular/kirupa.xml">

```

and extract the url so that in my rssreader, when someone enters a wrong url, the script searches if it can find an alternative url to an rss feed on the particular site.

Thanks in advance.
