Jump to content

Archived

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

wmoussalli

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

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\" /]

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

×

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.