If I wanted to save the actual site (HTML) then yes, it would be that easy.Kamal wrote:<?php function download($url, $save_to){ if(file_put_contents($save_to, file_get_contents($url))){ return true; }else { return false; } } ?>Isn't it that simple?
BetterPHP PHP Library
Re: BetterPHP PHP Library
-
- Posts: 534
- Joined: Thu May 05, 2011 8:19 pm
Re: BetterPHP PHP Library
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)
(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
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
Re: BetterPHP PHP Library
I could just right click on the image and save it then.bowersbros wrote: (Note. you can also just use the direct image url if you know it with the current function for it to work)
-
- Posts: 534
- Joined: Thu May 05, 2011 8:19 pm
Re: BetterPHP PHP Library
Yes. which is why i also suggested the way to do it automatically..
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
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
Re: BetterPHP PHP Library
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?
Re: BetterPHP PHP Library
That sounds perfect. It could just be used directly but I may use it as part of a larger image manipulation thing.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?
You will have to zip any php files. but upload them / it as an attachment to this topic
Re: BetterPHP PHP Library
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...
Re: BetterPHP PHP Library
So who will be the first to set up a GIT repository for this?
Re: BetterPHP PHP Library
Not melibeco wrote:So who will be the first to set up a GIT repository for this?
It's too much of a pain to use, although I guess it would be useful when there is more than one person contributing
Re: BetterPHP PHP Library
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...
Re: BetterPHP PHP Library
I'll set one up.
What should I call it and what should the description be?
What should I call it and what should the description be?
Re: BetterPHP PHP Library
Don't do that, I am doing it now.Kamal wrote:I'll set one up.
What should I call it and what should the description be?
Re: BetterPHP PHP Library
Ok. It shouldn't be hard though.jacek wrote:Don't do that, I am doing it now.Kamal wrote:I'll set one up.
What should I call it and what should the description be?
Re: BetterPHP PHP Library
Good, now give us the linkjacek wrote:It wasn’tKamal wrote:Ok. It shouldn't be hard though.
Re: BetterPHP PHP Library
I did, its in the first post.Kamal wrote:Good, now give us the link
If you have something to add I can make you a contributor.
Re: BetterPHP PHP Library
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.
Re: BetterPHP PHP Library
We need basic stuff too, if you have any useful functions fee free to post them
Re: BetterPHP PHP Library
jacek wrote:If you have something to add I can make you a contributor.
I may have some useful files stored somewhere on my computer.. I'll look for themjacek wrote:We need basic stuff too, if you have any useful functions fee free to post them
EDIT: Found these files: They are probably yours.. also they are quite helpful
Re: BetterPHP PHP Library
Yes they are mine
They are also the ones in the git if you bothered to look !
They are also the ones in the git if you bothered to look !