(PECL ssh2 >= 0.9.0)
ssh2_sftp_realpath — Resuelve la ruta real de una ruta proporcionada
Traduce un nombre de fichero filename
en su ruta
realmente efectiva en el sistema de ficheros remoto.
sftp
Un recurso SSH2 SFTP, abierto por la función ssh2_sftp().
filename
Ejemplo #1 Resolver un nombre de ruta
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$sftp = ssh2_sftp($connection);
$realpath = ssh2_sftp_realpath($sftp, '/home/username/../../../..//./usr/../etc/passwd');
/* $realpath es ahora: '/etc/passwd' */
?>