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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Caesar Posted July 12, 2007 Share Posted July 12, 2007 Those links provide working examples Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.