fbrown Posted July 12, 2007 Share Posted July 12, 2007 i have a page that was premade and i dont like it but some stuff on it is useful and i want to grab just it and include it on my home page the stuff i grab would be in html css and javascript so my question is does any one know how i would go about doing that Link to comment https://forums.phpfreaks.com/topic/59714-does-anyone-know-anything-about-web-fetching/ Share on other sites More sharing options...
per1os Posted July 12, 2007 Share Posted July 12, 2007 www.php.net/file_get_contents www.php.net/strpos www.php.net/preg_match Alot of different ways to perform webfetching. Link to comment https://forums.phpfreaks.com/topic/59714-does-anyone-know-anything-about-web-fetching/#findComment-296762 Share on other sites More sharing options...
fbrown Posted July 12, 2007 Author Share Posted July 12, 2007 could i get an example just so i could get an idea how to set it up Link to comment https://forums.phpfreaks.com/topic/59714-does-anyone-know-anything-about-web-fetching/#findComment-296770 Share on other sites More sharing options...
Caesar Posted July 12, 2007 Share Posted July 12, 2007 Those links provide working examples Link to comment https://forums.phpfreaks.com/topic/59714-does-anyone-know-anything-about-web-fetching/#findComment-296773 Share on other sites More sharing options...
per1os Posted July 12, 2007 Share Posted July 12, 2007 <?php $file = file_get_contents('http://yoursite.com'); $tables = split("<table", $file); echo '<pre>'; foreach ($tables as $table) { echo 'Start of table ' . $table . "\n<br />"; } ?> If you want parts of the page you simple use the strpos, or preg_match functions to parse out the data. www.php.net/split www.php.net/explode Those may also prove to be helpful. Link to comment https://forums.phpfreaks.com/topic/59714-does-anyone-know-anything-about-web-fetching/#findComment-296774 Share on other sites More sharing options...
fbrown Posted July 12, 2007 Author Share Posted July 12, 2007 thanks dude ill try it out and see were it goes Link to comment https://forums.phpfreaks.com/topic/59714-does-anyone-know-anything-about-web-fetching/#findComment-296783 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.