PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
agurchand
Forum Newbie
Posts: 1 Joined: Sat Jan 05, 2013 9:34 am
Post
by agurchand » Sat Jan 05, 2013 9:39 am
Do you know only one line of code will upload a image or file from a URL?
check this out:
Code: Select all
file_put_contents("uploads/$name", file_get_contents($url);
Please give your comments about this program friends.
social_experiment
DevNet Master
Posts: 2793 Joined: Sun Feb 15, 2009 11:08 am
Location: .za
Post
by social_experiment » Sat Jan 05, 2013 6:27 pm
technically you'd be making a copy of the file; what do you intend to use the script for?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
requinix
Spammer :|
Posts: 6617 Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA
Post
by requinix » Sat Jan 05, 2013 8:48 pm
copy() would be even easier.