Don't miss: Get a lifetime of Linux learning for under $110

Creating and changing files

Like reading files, creating and changing files can also be done in more than one way. Luckily for you, there are just two options this time: file_put_contents() and fwrite(). Both of these functions complement functions we just looked at, which are file_get_contents() and fread() respectively, and they work in mostly the same way.

 

Next chapter: file_put_contents() >>

Previous chapter: fopen() and fread()

Jump to:

 

Home: Table of Contents

Follow us on Identi.ca or Twitter

Username:   Password:
Create Account | About TuxRadar