[Help]extract. regex?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Pidgeon
Forum Newbie
Posts: 1
Joined: Wed Aug 19, 2009 12:01 pm

[Help]extract. regex?

Post by Pidgeon »

Hi, I'm new to PHP and have actually only been playing with it for a day. This is probably incredibly simple but i'm not too sure where i'm going wrong.

I want to get the random quote from: http://smacie.com/randomizer/
Heres my attempt:

Code: Select all

 
      <?php
      $file = file_get_contents("http://smacie.com/randomizer/blah.html")
preg_match("/big>(.*)<\/font>/",$file,$quote);
echo $quote[1];
      ?>
 
Last edited by Pidgeon on Wed Aug 19, 2009 1:14 pm, edited 1 time in total.
Post Reply