11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 10 • WORKING WITH THE FILE AND OPERATING SYSTEMwww.it-ebooks.infoint filectime(string filename)An example follows:This returns the following:File inode last changed: 06-09-10 1:26:14pm■ Note The last changed time differs from the last modified time in that the last changed time refers to anychange in the file’s inode data, including changes to permissions, owner, group, or other inode-specificinformation, whereas the last modified time refers to changes to the file’s content (specifically, byte size).Determining a File’s Last Modified TimeThe filemtime() function returns a file’s last modification time in Unix timestamp format or FALSEotherwise. Its prototype follows:int filemtime(string filename)The following code demonstrates how to place a “last modified” timestamp on a web page:This returns the following:File last updated: 06-09-10 1:26:14pmWorking with FilesWeb applications are rarely 100 percent self-contained; that is, most rely on some sort of external datasource to do anything interesting. Two prime examples of such data sources are files and databases. Inthis section, you’ll learn how to interact with files by way of an introduction to <strong>PHP</strong>’s numerous standardfile-related functions. But first it’s worth introducing a few basic concepts pertinent to this topic.236

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!