Okay, I've searched around and found some good examples, but now I'm stumped.
I'm trying to grab a version number of an application off of a website, and then stick that into a variable so I can compare it with the link I have and have it dynamically updated to show the newest version.
Here's the code I have thus far:
<?php
$url = "http://www.someurl.com";
$content = join('',file($url));
$length = strlen($content);
$startstring = strpos($content,"Super Duper App");
$endstring = strrpos($content,eregi("Version [0-9][0-9][0-9]",$content));
$tempresult = substr($content,$startstring,$endstring);
$appversion = substr($tempresult,-3,3);
echo $appversion;
?>
The problem is that $tempresult holds all the html code from the last strrpos index and onward. I'm sure it's blatantly obvious to some of you gurus out there. 😉
Any help is appreciated.
Note: Oh, and I know that the regexp there isn't foolproof, but the software is currently at v109, so I doubt they're going to hit v999 anytime soon. 🙂