Kamal wrote:[syntax=php]<?php function download($url, $save_to){ if(file_put_contents($save_to, file_get_contents($url))){ return true; }else { return false; } } ?>[/syntax] Isn't it that simple?
If I wanted to save the actual site (HTML) then yes, it would be that easy.
in that case, you need to read the source using the file_get_contents, then use a regular expression to sort out all the images within that page. Then use that function on the image URLs and it will download all images on a webpage.
(Note. you can also just use the direct image url if you know it with the current function for it to work)
I don't like to brag, but I wasn't circumcised. I was circumnavigated.
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
I have actually made a thumbnailer which resizes the image, and recentantly created a function that changes the size of a jpeg image :L I could upload it if you like?
Carbine wrote:I have actually made a thumbnailer which resizes the image, and recentantly created a function that changes the size of a jpeg image :L I could upload it if you like?
That sounds perfect. It could just be used directly but I may use it as part of a larger image manipulation thing.
You will have to zip any php files. but upload them / it as an attachment to this topic
Well I'm currently thinking about learning the GD Libary, and I could create a few functions I suppose. It seems interesting enough to not make me bored...
And that's where an IDE can prove itself. Painstakingly easy, just hit commit, do a pull and push, no writing command line crap in a terminal, console or whatever it's called...
This is a great idea, just noticed this thread. Today I started to build my own library as well, but it consists of some very basic things (notes, code pieces, functions, etc.) that I will be using frequently. I want to contribute to this thread later though.