Chapter 13. Working with Files and Directories


Testing for the existence of files, plus reading from them and writing to them, are important features of any rich programming language. PHP is no exception in that it provides functions that make these processes straightforward. Additionally, because PHP, Apache, and MySQL are not the only applications on your machine, there may come a time when you need to access those other applications from within your PHP code; elements in this chapter show you how to access other applications from within your PHP code. In this chapter, you will learn

  • How to include other files in your documents

  • How to test for the existence of files and directories

  • How to open a file before working with it

  • How to read data from files

  • How to write or append to a file

  • How to lock a file

  • How to work with directories

  • How to pipe data to and from external applications

  • How to send shell commands and display results in the browser




Sams Teach Yourself PHP, MySQL And Apache All in One
Sams Teach Yourself PHP, MySQL and Apache All in One (3rd Edition)
ISBN: 0672328739
EAN: 2147483647
Year: 2004
Pages: 327

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net