The following text: This article mainly introduces the PHP file read and write operation related function Summary, this article summarizes fwrite (), Fread (), fgets (), fgetc (), file (), ReadFile () and other functions of the introduction and use Example one, fwrite () Writing a file saves the data in the program to a file, and using the fwrite () function, you can write the contents of the string to the file. A newline character is represented in a file by a sequence of characters, representing the end of a line in the file. Keep this in mind when you need to enter or output one line of information at a time. Different operating systems have different end symbols, and UNIX-based systems use "\ n" as the line-ending character, based on the Windows system using "\ r \ n" as the line-ending character, and the Macintosh-based system uses "\ r" as the line-ending character. When you want to write a text file and want to insert a new row, you need to use the line end symbol for the appropriate operating system. The prototype of the function fwrite () is as follows: The code is as follows: Int fwrite (Resource h
1. About PHP fgetc () functions 10 articles recommended
Introduction: The following body: This article mainly introduces the PHP file read and write operation related function Summary, this paper summarizes the fwrite (), Fread (), fgets (), fgetc (), file (), ReadFile () and other functions of the introduction and use examples of a , fwrite () writes the file to save the data in the program to a file, and the fwrite () function can be used to write the string contents to the file. A newline character is represented in a file by a sequence of characters, representing the end of a line in the file. When you need to enter or lose one time ...
2. About PHP dirname () functions 10 articles recommended
Introduction: In the forum to read a lot of posts, but found that some people are not very likely to use. Think that the description is not detailed enough to achieve! I'll talk to you again. First, you create a new rss.php file, copy the following code into it: code is as follows: <? php require_once (DirName (__file__); "/include/common.inc.php"); &nbs ...
3. Recommended Articles for PHP clearstatcache () functions
Summary: The definition and usage of the Clearstatcache () function is to clear the file state cache. PHP's cached data is advantageous for faster and better running functions. If a file has been tested multiple times in a script, you may be prevented from caching the correct results. To achieve this, you can use the Clearstatcache () function. Syntax Clearstatcache () hints and notes: Perform cached functions: Stat () Lstat () file_exists () Is_wri ...
4. About PHP chown () functions 10 articles recommended
Introduction: The following function is chown related information Oh, well, crap don't say come to see it. Chown (PHP 4, PHP 5) chown-Change the file owner description of the Boolean chown (string $ file name, mixed $ user) attempt to change the archive owner profile to the user's user. Only supervisor can change people's files. parameter filename file path. User user name or number. The return value returns TRUE or False for a successful failure. Example <? php//File Name an ...
5. What is Total station static? Summary of static use method of PHP total station
Introduction: In the forum to read a lot of posts, but found that some people are not very likely to use. Think that the description is not detailed enough to achieve! I'll talk to you again. First, you create a new rss.php file, copy the following code into it: code is as follows: <? php require_once (DirName (__file__); "/include/common.inc.php"); &nbs ...
6. About PHP Trigger_error () functions 10 articles recommended
Summary: In some PHP built-in functions (such as mkdir), adding @ at the front can mask the error thrown by the function, so how does a custom function implement this? I tried the throw. New exception and Trigger_error cannot be added by the @ Mask: So, for example, I want to write a Jsonfile::get () method, when the file does not exist, throw a wrong, the path is illegal, throw a wrong, decoding failure, and return False when the user is concerned about the error message can be captured and processed by themselves;
7. About PHP Scandir () functions 10 articles recommended
Introduction: <?php $path = './fzlhead/'; function Get_filetree_scandir ($path) {$result = array (); $temp = Array (); if (!is_dir ($path) | |! Is_readable ($path)) return null; Detection of catalog Validity $allfiles = Scandir ($path); Get all files and folders under directory foreach ($allfiles as $file
8. About PHP Readdir () functions 10 articles recommended
Description://Determine if the directory is empty, True is empty, false is not empty function Is_empty_dir ($fp) { $H = @ opendir ($fp); $i =0; while ($_file=readdir ($H)) { $ i++; } close.
9. About PHP Opendir () functions 10 articles recommended
Description://Determine if the directory is empty, True is empty, false is not empty function Is_empty_dir ($fp) { $H = @ opendir ($fp); $i =0; while ($_file=readdir ($H)) { $ i++; } close.
10. About PHP GETCWD () functions 10 articles recommended
Summary: Related APIs: folder: Gets the current working directory, that is, the directory path of the current Python script work: OS.GETCWD () returns all files and directory names under the specified directory: Os.listdir () function to delete a file: Os.remove () Delete multiple directories: Os.removedirs (r "C:\python") verifies whether the given path is a file: Os.path.isfile () verifies that the given path is a directory: Os.path.isdir () is judged to be ...
"Related question and answer recommendation":
PYTHON-PIP installing any package is problematic: cannot unpack file/tmp/pip-kzjghd-unpack/simple
Pagoda panel configuration lamp, upload thinkphp, access error file not found, modify. htaccess appears unable to load the resource
C #-MVC development on vs2013 now on 2015 debug error details are as follows
ANGULAR.JS-ANGULAR2 Dynamic creation of sub-component ideas
JAVASCRIPT-IE8 under jquery input File no value