SoFunction
Updated on 2025-03-10

[PHP] Practical Function 6 Page 1/2

//Send an email to the specified email address to, subject represents the subject, and message is the content of the letter. Additional options additional_headers can be omitted, indicating the first part of other email documents

bool mail(string to,string subject,string message,string [additional——headers]
//Parse the URL string and return the result to the array. The returned array includes the following elements: scheme, host, port, path, query, and fragment, etc.

array parse_url(string url)
//Encode the string in URL, for example, a space will become a plus sign. The form data transmission on the web page is encoded and then sent out.

string urlencode(string str)
//Restore the string after encoding the URL

string urldecode(string str)
//You can open the link to the FTP server. The parameter host is the URL of the FTP server. Parameter port is usually omitted. If the port number (port) of the FTP server is not 21, this parameter needs to be added. If there is no error, the connection code will be returned, and if there is no error, the connection code will be returned, false will be returned.

int ftp_connect(string host,int [port])
//Loginable to link FTP server. The parameters ftp_stream and password are the user account and password of the FTP server. Usually anonymous is the public user account, and the password is a certain email address. Return true if successful

bool ftp_login(int ftp_stream,string username,string password)
//Used to obtain the path currently in the FTP server. The parameter ftp_stream is the connection code of FTP. If there is an error, return NULL

string ftp_pwd(int ftp_stream)
//Used to return to the upper directory, that is, the parent directory of the current directory. The parameter ftp_stream is the FTP connection code. Return true if successful

boolean ftp_cdup(int ftp_stream)
//Used to go to the next level directory. The parameter ftp_stream is the connection code of FTP. Parameter directory is the directory you want to go to. Return true for success, and return false for failure

bool ftp_chdir(int ftp_stream,string directory)
//Return the file name or array of the given directory

array ftp_nlist(int ftp_stream,string directory)
//Return the detailed list of a directory in the form of an output line array

array ftp_rawlist(int ftp_stream,string directory)
//The system that can display the remote FTP server is equivalent to the system or system instructions on the FTP server. Returns the string if successful, such as "215 UNIX Type: L8", and returns false if failed.

string ftp_systype(int ftp_stream)
// Used to download the specified file. The parameter ftp_stream is the connection code of FTP; the parameter local_file is the file name to be located on the local side; the parameter remote_file is the file name to be downloaded; the parameter mode has two values: FTP_ASCII and FTP_BINARY, which represent text files or binary files respectively. If successful, it will return true, and if it will fail, it will return false.

bool ftp_get(int ftp_stream,string local_file,string remote_file,int mode)
//Download the file and it exists in the opened local file. Parameter  fp is the file pointer of the opened file on the local side

bool ftp_fget(int ftp_stream,int fp,string remote_file,int mode)
//Used to upload the specified file. The parameter ftp_stream is the connection code of FTP; the parameter remote_file is the file name that wants to exist; the parameter local_file is the file name that wants to upload; the value of the parameter mode is FTP_ASCII and FTP_BINARY

bool ftp_put(int ftp_stream,string remote_file,string local_file,int mode)
//Send a cmd command to the FTP host. This command is not standardized, but is related to the server's host operating system. It can be used for file access permissions and group members' operations.

bool ftp_site(resource ftp_stream,string cmd)
//Close FTP connection

bool ftp_quit(int ftp_stream)
//The host domain name can be returned to a certain IP URL. If the execution fails, the original IP URL will be returned.

string gethostbyaddr(string ip_address)
//It can be transferred back to the IP URL of a certain network host. If the execution fails, the original computer domain name hostname is passed back to the

string gethostbyname(string hostname)
//Return the IP address list of the given host

array gethostbynamel(string hostname)
//Check whether there is a DNS record in the given Internet host name or IP address. The type can be A, MX, NS, SOA, TPR, CNAME or ANY. The default type is MX

int checkdnsrr(string host [,stringtype])
//Get the MX record corresponding to the given Internet host name
12Next pageRead the full text