O'Reilly logo

PHP for Teens by Maneesh Sethi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Renaming, Copying, and Deleting Files

There are only a few more functions that I want to go over before finishing off this chapter. These three functions are commonly used in file situations, both on a computer and on a web site. They are simple to use, and all return a Boolean value. If the function is successful, the function returns true; if it is false, the function returns false.

copy

The first function copies:

copy($source_filename, $destination_filename)

When using the copy function, the program knows already that the source file needs to be opened for reading and the destination file needs to be open for writing. Because of this, the function does not require that you pass in a handle of a file, but just the filename. The function actually ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required