Tuesday, 4 September 2012

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

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)

Ans: C

No comments: