Jump to content

Scan a URL for a specific word on page????? Need a pro's help...


wmoussalli

Recommended Posts

I need php script that will enable me to scan a url for a specific word, then copy the next word after it to a vaiable...

Imagine scanning this sites hompage for totalposts and then grabbing the following number and displaying it on my site...


[b]Thanking you for your time....[/b]

Wayne [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /]
Link to comment
Share on other sites

[code]
<?php
$filename = "http://www.yourdomain.com/index.php";
$contents = file_get_contents($filename);//read the url
preg_match("`([0-9]+) User\(s\) are browsing this forum`",$contents,$var);//write a RE to parse the contents
?>
//$var[1] will contain the no of users
[/code]
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.