[PHP] Utility function 9_php Tutorial

Source: Internet
Author: User
An external program or external instruction that executes the input command. The return string is only the last line returned by the external program execution, and if you need to return the information completely, you can use PassThru ()

String exec (string command,string [Array],int [Return_var])
Used to execute the instruction and output the result. If the Return_var parameter is present, the state after the command is executed is populated with the Return_var

String System (String Command,int [Return_var]
Executes as an external program and displays the original output

String PassThru (String command,int [Return_var])
Remove special symbols from a string

String escapeshellcmd (String command)
Used to lock files so that other processes cannot access them. The passed-in parameter FP is a file pointer. The value of the parameter operation is one of the following numbers: 1 indicates that the lock file can allow other processes to read, 2 indicates that only the process can write to the file, 3 means that read and write are locked, and 4 does not lock the file block (block)

BOOL Flock (int fp,int operation)
Extracts all <meta> flag content properties from a file and returns an array

Array get_meta_tags (string Filename[,int Use_include_path])
Reads an entire file into an array, each line as an array element

Array file (void)
Creates a writable temporary file that is automatically deleted when the fclose () function is called or when the script ends

Array tmpfile (void)
Open a file or URL and return a file pointer

int fopen (string filename,string mode)
Close an open file pointer

int fclose (int fp)
Test a file pointer to see if the end of the file

int feof (int fp)
Use the file pointer to get a row

String fgets (int fp,int length)
The same fgets () function, and also remove the HTML language in the retrieval string and the markup character of the PHP syntax

String fgetss (int fp,int length)
Gets the character that the file pointer refers to. The pointer returns False if it is EOF

string fgetc (int fp)
Writes string strings to the file data stream on the pointer FP. If length is specified, the length of the string is written, or the end of the string is written

int fwrite (int fp,string string,int [lenth])
Force a write operation to a file pointed to by the FP

int fflush (int fp)
Move the position of the file pointer to the beginning of the file

int rewind (int fp)
Returns the pointer offset bit (offset) value for the file FP. Returns False when an error occurs

int ftell (int fp)
Moves the file FP pointer to the specified offset bit (offset). When FP is opened by fopen () http://... Or ftp://... This function is invalid when you wait for a URL file

int fseek (int fp,int offset)
Reads the file and writes the file contents to the standard output device

int ReadFile (string filename)
Reads the file FP until EOF and outputs the data to standard output

int fpassthru (int fp)

http://www.bkjia.com/PHPjc/318595.html www.bkjia.com true http://www.bkjia.com/PHPjc/318595.html techarticle //external program or external instruction to execute input command. The return string is only the last line returned by the external program execution, and if you need to return the information completely, you can use PassThru () Stringex ...

  • Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.