Application Example of PHP File Reading Function
This article mainly introduces the application examples of the PHP File Reading function and the usage methods and differences of common file data reading functions. It is very detailed. If you need
Http://www.programfan.com/article/showarticle.asp? Id = 2697
The so-called "file" refers to an ordered set of related data. This dataset has a name called a file name. In fact, we have used files many times in the previous chapter, such as source
Discuz 5.0 do not use their own IP data, but the use of pure IP data format, access to the pure IP database a little trouble, its storage format is more special and interesting, the specific format of the analysis of the following two links, other
File directory:
Iplocation-----Qqwry----------QQWry.Dat-----ipCity.class.php
ipCity.class.php File Code:
Copy Code code as follows:
Class IpCity {
/*** According to the IP address to obtain the corresponding city* @param type
Php display area code by IP address php display area code by IP
Script ec (2); script
Define ('ipdata _ MINI ', PHPCMS_ROOT. 'include/IPDATA/mini. Dat ');Define ('ipdata _ full', PHPCMS_ROOT. 'include/IPDATA/QQWry. Dat ');
Class ip_area{Var $ fp
PHP file read operations involve more PHP file operation functions than file write operations. These functions are described in detail in the Code instance.The Data Storage Method for reading text files involves the following three steps and some
Windows GDI providesTypedef struct tagBITMAPFILEHEADER {WORD bfType;DWORD bfSize;WORD bfReserved1;WORD bfReserved2;DWORD bfOffBits;} BITMAPFILEHEADER, * PBITMAPFILEHEADER;The BITMAPINFO structure of the BMP Information header is as follows:
Typedef
Display images using DirectX SDK. One is reading BMP files from files, and the other is reading files from memory (to read files for packaging files). I have tested it, calling this function to read image files is faster than the built-in system.
Implementation principle of little hacker VC
The implementation principle is very simple. It mainly consists of 1. hook up with the foreground application 2. Collect the required information (that is, the password.
So how can we hook up with other
In the previous PHP Tutorial, I introduced how to use PHP to implement the file write function in file read/write operations. next I will share with you the application example of the PHP file read function, php file read operations involve more php
It is quite easy to get the IP address first. The following describes two codes for getting the IP address first. You need to use the QQIP library to find the IP address that belongs to the current IP address segment and then obtain the City field
1. The block number of the inode file. During the Linux kernel read and write operations, the corresponding disk block is operated based on the disk block number in the inode to complete file read and write. The MV command is used to move a file.
Get IP Address
Copy codeThe Code is as follows: Function GetIP (){
If ($ _ SERVER ["HTTP_X_FORWARDED_FOR"])
$ Ip = $ _ SERVER ["HTTP_X_FORWARDED_FOR"];
Else if ($ _ SERVER ["HTTP_CLIENT_IP"])
$ Ip = $ _ SERVER ["HTTP_CLIENT_IP"];
Else if ($ _ SERVER
Php determines the source code of the IP address. The following code judges the user's city based on the IP address, php judges that the IP address location source code is completely open. the following code calls us to determine the user based on
PHP obtains the specific implementation of the city based on the IP address. File Directory: ipLocation ----- qqwry ---------- QQWry. Dat ----- ipCity. class. phpipCity. class. php file code: Copy the code as follows :? PhpclassipCity {*** obtain
Basic operations on php files
// Basic file operations
// Fopen ()
Open a file
// Open a file in the absolute path, select read-only mode, and return the resource $ handle
$ Handle = fopen
Php file read/write operations. Php file read operations involve more php file operation functions than file write operations. these functions are described in detail in the code instance. Reading text files to store data mainly involves more php
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.