In PHP fsockopen function can imitate the user to visit some Web site and can also bring some common information, if the browser, Ip,post,get and so on data, I will introduce each of you.
If you want to use the Fsockopen function we must set the
the fopen function is used to open the file in PHP.
The first parameter of this function contains the name of the file to be opened, and the second parameter specifies which mode to use to open the file;
The file may be opened in the following
The PDF file in the server is healthy: Verified by direct FTP download.
Some of the code for the downloader is as follows:
$file _size = filesize ($filedir);
Header ("content-type:application/octet-stream;charset=iso-8859-1");
Header
81. Call function, complete the establishment of a one-way dynamic linked list, output the values of each node.1#include 2#include 3 4typedefstructLST5 {6 intnum;7 structLST *Next;8 }lst;9 TenLST *mycreat () One { A intm; -LST *head, *p,
In ANSI C, the operation of the file is divided into two ways, that is, streaming file operations and I/O file operations, respectively, described below.One, streaming file operationThe file operations in this way have an important structure
Fsockopen is a very powerful function, support socket programming, you can use Fsockopen to implement the mail and other socket programs, etc., using fcockopen need to manually stitching out the header section. For details, refer to the official
Title PHP// directory operation//mkdir ("./www");//Create Directory,//rmdir ("./www");//delete directory (directory must be empty to delete);//rename ("./img"); , "./phpmyadmin/img");//Move the file, the first one is the file that needs to be moved,
C-based file operationsIn ANSI C, the operation of the file is divided into two ways, that is, streaming file operations and I/O file operations, respectively, described below.One, streaming file operationThe file operations in this way have an
1. Open File (fopen)Syntax:resource $fp =fopen (file address, mode), returns the file pointer (filename pointer)
Mode
Meaning
R
Read-only
W
Write (empty rewrite)
A
fopen (Open file)Correlation function Open,fcloseTable header file #include Defines the function FILE * fopen (const char * path,const char * mode);Function description The path string contains the file path and filename to open, and the parameter
PHP read the file a variety of methods, come together to see it.One of the pleasures of dealing with modern programming languages such as PHP is that there are a number of options available. PHP can easily win Perl's motto "There's more than one
Share the PHP read the file in eight ways, collected a lot of PHP read file examples, small and classic, is to learn PHP file operation good information.There are several ways to read files in PHP.1.freadstring fread (int $handle, int $length)Fread (
C language Fread () function: Read file function (read data from file stream)
Header file:
#include
To define a function:
size_t fread (void * ptr, size_t size, size_t nmemb, FILE * stream);
Function Description: Fread (
I have sorted out several methods of reading files in PHP, which is convenient to consult later.
1.fread
string fread (int $handle, int $length)
Fread () reads up to length bytes from the file pointed to by handle. The function stops reading a
One, fwrite () write file
It is easier to save data in a program to a file, using the fwrite () function to write the contents of the string to a file. In a file, a newline character is represented by a sequence of characters, representing the end
First, open the flow
1. Concept:
The fopen function opens a specific file and associates a stream with the file.
2. Function prototype:
FILE *fopen (char const *name, char const *mode);
Release:
1) Name of the file or device you want to open.
2)
C-based file operations
In ANSI C, the operation of the file is divided into two ways, that is, streaming file operations and I/O file operations, respectively, described below.
One, streaming file operation
The file operations in this way have an
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.