|
-
Mar 13th, 2009, 07:44 PM
#1
Thread Starter
Member
-
Mar 13th, 2009, 08:26 PM
#2
Re: Grab and display HTML from between two points
I do not understand why you need to do this. I assume you have permission from the copyright owner to do this too.
-
Mar 13th, 2009, 08:30 PM
#3
Thread Starter
Member
Re: Grab and display HTML from between two points
From a friends website, to my website . And yes, permission granted
-
Mar 14th, 2009, 12:07 AM
#4
Re: Grab and display HTML from between two points
you can use file_get_contents() to grab a page's contents. then, you can use strpos() and substr() to get the information you'd like.
PHP Code:
<?php $content = file_get_contents("http://apple.com/pie.htm");
//where we should start and end $start = "<table class=\"pips\">"; $end = "</table>"; $st_pos = strpos($content, $start) + strlen($start); //starting position $en_pos = strpos($content, $end); //end position
$content = substr($content, $st_pos, $en_pos - $st_pos);
echo $content; ?>
-
Mar 14th, 2009, 05:47 PM
#5
Thread Starter
Member
Re: Grab and display HTML from between two points
Works a treat, thankyou!
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
|