|
-
Apr 18th, 2012, 05:01 AM
#3
Thread Starter
Lively Member
Re: Help with preg_match regex
Yes there is, sorry for not posting it.
The $html variable, as you may have guessed, contains the html of a whole page, fetched using file_get_contents.
It seems that if I put the real html in the $html variable, the thing breaks.
PHP Code:
$name = "ttt_giant_daycare_V2.zip"; $url = "http://freesteam.org/gmod/search.php?searchterm=" . $name; $html = file_get_contents($url);
$regex = '#[0-9]{1,9}(?=">' . $name . '</a>)#'; preg_match($regex, $html, $matches); echo $matches[0];
That is the whole code, my fault for not posting it.
It can also be executed here, at my dev server:
http://fredrikblomqvist.developer.se/dev/getaddon.php
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|