Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[PHP & NSFW] preg_match of file_get_contents(url)

Skilled Illusionist
Joined
Jul 1, 2007
Messages
367
Reaction score
1
Yo!

Haven't been on here in a long, long time, but you guys have always been accommodating and helpful when it comes to Coder's Paradise :)

I'm having trouble today, and, as embarrassing as it is (it's a small joke project), I'm trying to grab the link from the HTML source of a porn site. (please don't ban me :*:)

Here's what I have so far (so stupid):
PHP:
$file = file_get_contents_utf8('http://www.xnxx.com');
//preg_match("'<p class=\"review\">([^<]*)</p>'si", $file, $matches);
preg_match("'<a href=(.*?)/class=\"miniature\">'si", $file, $matches);
list(, $value) = $matches;

echo $value;

Ignore the file_get_contents_utf8, it's a working function. My problem is the preg_match won't pick up on what I'm looking for (I think I've typed in the search wrong, or used the wrong divider "(.*?)".

The links I want are in these suckers:
Code:
<a href="http://video.xnxx.com/video1352353/0/valentine_bang" class="miniature">

Do you guys have any feedback? Thanks in advance and sorry for NSFW post. <3
 
Infraction Baɴɴed
Loyal Member
Joined
Apr 9, 2008
Messages
1,416
Reaction score
169
question is are you trying to download the video in the links?
 
Back
Top