//Iteration in Directory
$path = realpath('registry');
$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);
$path_live = array();
foreach($objects as $name => $object)
{
if (is_file($name))
$path_live[] = $name;
}
-------------------------------------------------------------------------------
我想让这个在两个VPS之间工作吗?
我已安装phpseclib并可以登录远程VPS,但我不知道如何让它工作。
任何帮助将不胜感激
答案 0 :(得分:0)
//Iteration in Directory
$path = realpath('registry');
$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);
$path_live = array();
foreach($objects as $name => $object)
{
if (is_file($name))
$path_live[] = $name;
}
//Iteration in Directory
$path2 = realpath('...');
$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path2), RecursiveIteratorIterator::SELF_FIRST);
$path_live = array();
foreach($objects as $name => $object)
{
if (is_file($name))
$path_live[] = $name;
}
适合我。如果您正在尝试使用两个VPS,那么您将不得不详细说明。