- example unification

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@211458 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Leszek Krupinski 2006-04-16 11:49:21 +00:00
parent dacc93ac01
commit 4ae21f78ed

View file

@ -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>