Javatpoint Logo
Javatpoint Logo

PHP ftp_exec() Function

The ftp_exec() function is used to request for execution of a command on the FTP server. This function was introduced in PHP 4.0.3.

Syntax:

Parameter Description Is compulsory
ftp_connection The link identifier of the FTP connection. compulsory
Command The command to execute. compulsory

Returns

The ftp_exec() function returns true on success or false on failure.

Example 1

Explanation

In the above example, we are requesting for a 'Is -al' command to execute on FTP server.

Example 2

In the above example, we are requesting to our ftp server to execute 'lcd' command if it is executed, then it echo "executed successfully" if not, then it echo "could not execute".


Next TopicPHP FTP





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA