Jump to content

Grab text from another webpage


garyjames82

Recommended Posts

I am a complete newb, and I have tried honest I have.  I am trying to pull a random quote from a webpage to put in my own page.  As far as I know the following should do that, but it does not work.  Please help.

 

<?php
$data = file_get_contents("http://www.bbc.co.uk/comedy/reddwarf/factbox/index.shtml");
preg_match("/send.*?Suggestion/", $data, $matches);
echo $matches[0];
?>

Link to comment
https://forums.phpfreaks.com/topic/91815-grab-text-from-another-webpage/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.