scarhand Posted November 18, 2008 Share Posted November 18, 2008 I'm trying to write a script that allows someone to enter an URL, then submit the form, then it will show all the images from that URL. What would the best way of going about this be? use file_get_contents with some regex? are there any scripts out there that already do this? Quote Link to comment https://forums.phpfreaks.com/topic/133140-getting-all-images-from-a-given-url/ Share on other sites More sharing options...
enkay Posted November 18, 2008 Share Posted November 18, 2008 I'm not sure I understand your question, how would there be more than one file at a given URL? Is the URL a folder? Quote Link to comment https://forums.phpfreaks.com/topic/133140-getting-all-images-from-a-given-url/#findComment-692452 Share on other sites More sharing options...
premiso Posted November 18, 2008 Share Posted November 18, 2008 file_get_contents with regex is a good way to do it. Given that the url allows hotlinking. Quote Link to comment https://forums.phpfreaks.com/topic/133140-getting-all-images-from-a-given-url/#findComment-692454 Share on other sites More sharing options...
snowman15 Posted November 18, 2008 Share Posted November 18, 2008 Yea that would be the best way. In my experiences though, the CURL library works A LOT faster then a file_get_contents for retrieving the source. If you can get your hands on some good curl code. Quote Link to comment https://forums.phpfreaks.com/topic/133140-getting-all-images-from-a-given-url/#findComment-692456 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.