mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
- example unification
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@211458 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
dacc93ac01
commit
4ae21f78ed
1 changed files with 10 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<refentry id='function.ftp-exec'>
|
||||
<refnamediv>
|
||||
<refname>ftp_exec</refname>
|
||||
|
@ -56,18 +56,25 @@
|
|||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// variable initialization
|
||||
$command = 'ls -al >files.txt';
|
||||
|
||||
// set up basic connection
|
||||
$conn_id = ftp_connect($ftp_server);
|
||||
|
||||
// login with username and password
|
||||
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
|
||||
|
||||
// execute command
|
||||
if (ftp_exec($conn_id, $command)) {
|
||||
echo "$command executed successfully<br />\n";
|
||||
echo "$command executed successfully\n";
|
||||
} else {
|
||||
echo 'could not execute ' . $command;
|
||||
echo "could not execute $command\n";
|
||||
}
|
||||
|
||||
// close the connection
|
||||
ftp_close($conn_id);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
Loading…
Reference in a new issue