PrateekSaxena Posted September 13, 2007 Share Posted September 13, 2007 Hello,Is there any function in PHP that allows me to get all the contents of the file. And along with the contents their details like the date of creation and last modification, the type of file etc. Link to comment Share on other sites More sharing options...
Synook Posted September 13, 2007 Share Posted September 13, 2007 You can get the contents of a file with file_get_contents();All sorts of details can be gathered about the file with the following functions:fileatime() - Returns the last access time of a filefilectime() - Returns the last change time of a filefilegroup() - Returns the group ID of a filefileinode() - Returns the inode number of a filefilemtime() - Returns the last modification time of a filefileowner() - Returns the user ID (owner) of a filefileperms() - Returns the permissions of a filefilesize() - Returns the file sizefiletype() - Returns the file typeAlso have a look at the W3Schools PHP filesystem reference: http://www.w3schools.com/php/php_ref_filesystem.asp Link to comment Share on other sites More sharing options...
PrateekSaxena Posted September 13, 2007 Author Share Posted September 13, 2007 You can get the contents of a file with file_get_contents();All sorts of details can be gathered about the file with the following functions:fileatime() - Returns the last access time of a filefilectime() - Returns the last change time of a filefilegroup() - Returns the group ID of a filefileinode() - Returns the inode number of a filefilemtime() - Returns the last modification time of a filefileowner() - Returns the user ID (owner) of a filefileperms() - Returns the permissions of a filefilesize() - Returns the file sizefiletype() - Returns the file typeAlso have a look at the W3Schools PHP filesystem reference: http://www.w3schools.com/php/php_ref_filesystem.asp Hey..thanks a lot for that link. And about getting the contents of the folder? Link to comment Share on other sites More sharing options...
Synook Posted September 13, 2007 Share Posted September 13, 2007 http://www.w3schools.com/php/func_filesystem_glob.asp Link to comment Share on other sites More sharing options...
PrateekSaxena Posted September 13, 2007 Author Share Posted September 13, 2007 Just what I wanted man. Thanks a lot! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.