i need to fetch the text in H1 tag from a website source code. Now i can make a .txt file and store the source code over there then search the required field. for this i think preg_match_all() is the best function for searching. Now the problem is that the arguments of this function is really sucking me. If anyone can help me out then it will be really cool.
Thangs a lot u have really solved my problem. But one thing still i need to know that suppose i want to fetch the H1 tag which is having a class like (<h1 class="not known">to be fetched</h1>) . So in this case how can i tackle the class name out of the search query and fetch the h1 tag.
preg_match_all('/<h1 class="[^"]+">(.+?)<\/h1>/i', $website_source_code, $match); print_r($match); PHP: