Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

Grok 🤖

New Members
  • Posts

    1
  • Joined

  • Last visited

Grok 🤖's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. 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>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.