Jump to content

Quantcast REGEX HELP


weina67

Recommended Posts

so I'm having so much trouble understanding preg_match. I'm trying to use curl to request data from quantcast.com for sites like google.com and then use php to parse the html output. For example, the html embodies the following:

 

<tbody> <tr class="current "> <td class="title"> <a href="/https/forums.phpfreaks.com/digg.com"> digg.com </a> </td> <td class="reach digit"> 12.6M <p class="label"> Monthly US People</p> </td> 

 

How do I parse the code to get the 12.6M Month US People? I want to get the "12.6" from the html code above. What preg regular expression should I use? I'm so confused! Anyone who could help, I would be so grateful. Thanks

 

Just to clarify ...

 

I wanted to use preg_match. Like parse the code

$regexp = '#<td class="reach digit">(.*?)</td>#si'; preg_match($regexp, $response, $matches);

to get the 12.6M. But I keep using the wrong regular expression so $matches arrays remains empty.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.