Jump to content

Small preg_match help needed


aditya_sfs

Recommended Posts

Hello guys,

I am a PHP newbie and need a bit of help in developing a tool.

I need to count the number of backlinks a site has in MSN. For this i search msn for "link:www.domain.com". I use the following code to do this

<?php
$lines = file('http://search.live.com/results.aspx?q=link%3Adomain.com');
echo "Line #73 : " . htmlspecialchars($lines[73]) . "<br />\n";
?>

Now line 73 is a big complicated HTML string which can be accessed with $lines[73]. Somewhere in the sting, a small part of it is -

<h1>link:domain.com</h1><h5>Page 1 of 26,915 results</h5>

Now i want to get that number 26,915 out in another variable and also removing out that comma so that i could do arithmetic operations on it.

Please help me. I tried to do it for hours but unsuccessful with the preg_match

regards
Aditya
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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