I am new to Regualr Expressions, and I am just not getting the hang of it yet.
I have grabbed html content from a given webpage using CURL and PHP. This webpage never changes its structure. The results on the page are dependant on a search function, but the html tags are always the same. I need to grab the resulting data from the page depending on what search terms were entered.
The data I need is:
<h1 class="location_only">(555) 555-5555 is a Landline</h1>
So I need to grab whatever is inbetween
<h1 class="location_only">
and </h1>
If I have $data
, which is the resulting HTML, how do I put that into a regular expression and echo the data I find as $result
?