[PHP] Practical functions 9_php Tips

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

String exec (string command,string [Array],int [Return_var])
Used to execute instructions and output the results. If the Return_var parameter exists, the state after executing the command is filled in 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])
To remove a special symbol in 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 digits: 1 means that the set lock file can allow other processes to read, 2 indicates that only the process can write to the file, 3 is locked for both reads and writes, and 4 does not lock the file blocks (block)

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

Array get_meta_tags (string Filename[,int Use_include_path])
Read the entire file into an array, each row as an array element

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

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

int fopen (string filename,string mode)
Closes 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)
function with Fgets () and simultaneously remove the markup characters from the HTML language and PHP syntax in the retrieve string

String fgetss (int fp,int length)
Gets the character that the file pointer refers to. The pointer returns False if it is in 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 written to the end of the string

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

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 (offset) value of the file FP. Returns False when an error occurs

int ftell (int fp)
Moves the pointer of the file FP to the specified offset bit (offset). When FP is opened by fopen () http://... Or ftp://... This function is not valid when the URL file is

int fseek (int fp,int offset)
Read the file and write the contents of the file to the standard output device

int ReadFile (string filename)
Read file FP until EOF, and output data to standard output

int fpassthru (int fp)

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.