devWhiz Posted February 28, 2011 Share Posted February 28, 2011 <?php $URL1 = file_get_contents('http://www.yahoo.com'); $URL2 = file_get_contents('http://www.google.com'); ?> How would I make PHP load URL1 and URL2 at the same time.. I would add more than 2 urls also, Im tyring to test something with my website, load up to 50 links at once, how would I do this? Thanks Link to comment https://forums.phpfreaks.com/topic/229094-php-to-load-more-than-one-url-at-once/ Share on other sites More sharing options...
kenrbnsn Posted February 28, 2011 Share Posted February 28, 2011 You can not run things asynchronously with PHP (which is what you're asking to do). You might be able to do it with JavaScript and AJAX, but I believe there is a limit to the number of asynchronous threads you can start with AJAX and that limit is much less than 50. Why do you want to do this? Ken Link to comment https://forums.phpfreaks.com/topic/229094-php-to-load-more-than-one-url-at-once/#findComment-1180653 Share on other sites More sharing options...
devWhiz Posted February 28, 2011 Author Share Posted February 28, 2011 what would be the quickest way to load a url? Link to comment https://forums.phpfreaks.com/topic/229094-php-to-load-more-than-one-url-at-once/#findComment-1180707 Share on other sites More sharing options...
kenrbnsn Posted February 28, 2011 Share Posted February 28, 2011 Again, what are you trying to do? Ken Link to comment https://forums.phpfreaks.com/topic/229094-php-to-load-more-than-one-url-at-once/#findComment-1180771 Share on other sites More sharing options...
devWhiz Posted March 1, 2011 Author Share Posted March 1, 2011 Just load a header really fast but it would be better if there was a way I could do this simultaneously Link to comment https://forums.phpfreaks.com/topic/229094-php-to-load-more-than-one-url-at-once/#findComment-1181049 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.