I've been struggling with the preg_match function to extract a certain part of HTML from a curl function. Specifically, here is part of the HTML. I want to extract the "14" and the "93%". I tried using something like:
preg_match_all('/qualitySurveyGenericBoxHeader(?>[^>]+)>((?>[^<]+))eys/', $file_contents, $matches, PREG_SET_ORDER); to get the string from "quality" upto "Surveys", but it is not working. I am not sure if it is because there are spaces and \n or something to do with what curl is putting out.
<span class="qualitySurveyHeaderLeftColumn">
<span class="qualitySurveyGenericBox">
<span class="qualitySurveyGenericBoxInner qualityOverallRating">
<span class="qualitySurveyGenericBoxHeader"></span>
<span class="qualitySurveyGenericBoxContent">
<h4><span class="value" style="display:none" >5</span><span class="best" style="display:none">5</span><span class="rating" style="display:none">5"</span><span class="votes" style="display:none">14" </span>93%</h4>
<div>
<span>of Dr. Hinkleys patients <strong>would recommend her to friends and family.</strong></span><br />
<span>(based on 14 Surveys)</span>
</div>
</span>
</span>
</span>