# PHP: Extraction of tags from html content

**URL:** <https://forum.kirupa.com/t/php-extraction-of-tags-from-html-content/242913>\
**Category:** programming\
**Created:** [October 31, 2007, 5:21pm UTC](https://forum.kirupa.com/t/php-extraction-of-tags-from-html-content/242913 "2007-10-31T17:21:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![silverType](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@silverType](https://forum.kirupa.com/u/silverType)\
**Post date:** [October 31, 2007, 5:21pm UTC](https://forum.kirupa.com/t/php-extraction-of-tags-from-html-content/242913/1 "2007-10-31T17:21:41Z")

</div>

Hi guys,

I was trying to achieve the following:

1. Retrieve content of a website and assign it to a variable:  
$content = file\_get\_contents(“[http://www.somewebsite.com](http://www.somewebsite.com)”) or die(“Can’t open URL”);

1. Detect for all occurances of textbox stored in $content and retrieves it’s ID or Name.

Any suggestions on how this can be done? Thanks in advance.
