Programming Languages PHP Objective
Mar 15, 2013

What's the best way to copy a file from within a piece of PHP?

Choose the correct answer:
A) Print out a message asking your user to "telnet" in to the server and copy the file for you
B) Open the input and output files, and use read() and write() to copy the data block by block until read() returns a zero
C) Use the built in copy() function
D) Use "exec" to run an operating system command such as cp (Unix, Linux) or copy (Windows)
Detailed Explanation

Option C is the right answer.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback