PHP 8.5.0 Alpha 4 available for testing

Voting

: max(seven, nine)?
(Example: nine)

The Note You're Voting On

Mike <esnik8202 at sneakemail dot com>
19 years ago
To list directory contents:

<?php
$connection
= ssh2_connect(\"hostname\", 22);
ssh2_auth_password(
$connection,\"username\", \"password\"); // or use any of the ssh2_auth_* methods
$sftp = ssh2_sftp($connection);

$dh = opendir(\"ssh2.sftp://$sftp/path/to/dir/\");

while ((
$file = readdir($dh)) !== false) {
echo \"
$file is in hostname:/path/to/dir\\n\";
}

closedir(
$dh);
?>

(thanks to Sara for assisting)

<< Back to user notes page

To Top