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
Hello, I have a question about php file processing. I wrote the upload code to experience fread(development and fgetc(development, the content of the file test.txt is the thisisatestfile.txt file encoded in UTF-8 format {code ...} the above code can
Hello everyone, there is a question about PHP processing files, ask you.
I wrote a piece of code to experience Fread () and fgetc (), and the contents of the file Test.txt are this is a test file. TXT file encoded as Utf-8 format
The
PHP fgetc functions
Fgetc(PHP 4, PHP 5)Fgetc-Gets the character from the file pointerDescribeString fgetc (resource $ processing)Gets a character from the given file pointer.ParametersHandleThe file pointer must be valid and must point to a file
Php fgetc Function
Fgetc(PHP 4 and PHP 5)Fgetc-get the character pointer from the fileDescriptionString fgetc (resource $ processing)Gets a character pointer from a given file.ParametersHandleThe file pointer must be valid and must point to a file
The Fread (), fgets (), fgetc (), file_get_contents (), and file () functions are used to read content from a file. Fread ()The Fread () function is used to read the file (it can be used safely in binary files)Syntax: string fread (int handle,int
The FGETC () function reads a character from the file pointer. The function may return a Boolean value of false, but it may also return a non-Boolean value equivalent to False, such as 0 or "".
Grammar
Fgetc (file)
The parameter file is required.
A Directory Operations
BaseName--Returns the file name portion of the path
DirName--Returns the directory portion of the path
PathInfo--Returns information about the file path
Realpath--Returns the normalized absolute path name
Copy CodeThe code is
Phpfgetc function. Phpfgetc function fgetc (in PHP4, in PHP5) fgetc-gets a character from the file pointer description string fgetc (resource $ processing) to get a character from the given file pointer. Parameter handle php fgetc function
Fgetc(PHP
PHP file read operations involve more PHP file manipulation functions than file writes, which are described in detail in code instances.
The way in which data is stored in a text file is mainly three steps and some file operation functions are as
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.