Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 1 year ago. The community reviewed whether to reopen this question 7 months ago and left it closed: Original close reason(s) were not resolved Improve this question
Tag: file
Quickest Way to Read First Line from File
What’s the quickest, easiest way to read the first line only from a file? I know you can use file, but in my case there’s no point in wasting the time loading the whole file. Preferably a one-liner.
PHP: how can I get file creation date?
I am reading a folder with lots of files. How can I get the creation date of a file. I don’t see any direct function to get it. There are filemtime and filectime. And if the file hasn’t been modified, what will happen? Answer Use filectime. For Windows it will return the creation time, and for Unix the change time
How to validate a PHP file with W3C.org
I want to validate my PHP project to meet the W3C standard. Can some one explain how to do the PHP file validation using W3C.org? Is it possible to validate PHP files from the linux console?
Encrypting / Decrypting file with Mcrypt
Trying to write a couple of functions that will encrypt or decrypt a file and am using the class found here to try and accomplish this: http://www.itnewb.com/v/PHP-Encryption-Decryption-Using-the-…
.htaccess deny access to specific files? more than one
I am able to disable access to a file with .htaccess, but I don’t know how to disallow multiple files to be viewed (directly, not from includes) They are .php so I can’t disable a file type (like the only tutorials online say..) Or something.. For example “home.php, file.php , test.php” how do I disallow access to all three files
is_file or file_exists in PHP
I need to check if a file is on HDD at a specified location ($path.$file_name). Which is the difference between is_file() and file_exists() functions and which is better/faster to use in PHP? Answer is_file() will return false if the given path points to a directory. file_exists() will return true if the given path points to a valid file or directory.
How can I change a file’s extension using PHP?
How can I change a file’s extension using PHP? Ex: photo.jpg to photo.exe Answer In modern operating systems, filenames very well might contain periods long before the file extension, for instance: PHP provides a way to find the filename without the extension that takes this into account, then just add the new extension: