I made a script that looks in a URL for jpg's and their links.
So the result is:
s1.jpg links to b1.jpg
s2.jpg links to b2.jpg
etc etc
But now I would like to check if b1.jpg is bigger then s1.jpg, if not the script must
stop. But I can't figure out to do this.
My script so far:
<?
$fp=fopen('http://www.mydomain.com/test.htm','r');
$text=fread($fp,100000);
fclose($fp);
$preg='/
<a
[^>]*
href=
"?\'?
([^"\'>]*\.jpg)
[^>]*
>
([^<]|<(?!a))*
<img
[^>]*
src=
"?\'?
([^"\'>]*\.jpg)
[^>]*
>
([^<]|<(?!a))*
<\/a
/siUx';
preg_match_all($preg,$text,$matches);
for ($k=0;$k<count($matches[0]);$k++){
echo $matches[3][$k].' linkt naar '.$matches[1][$k].'<br>';
}
?>