php > var_dump("\1", '\1', "\g1", '\g1', "\\1");
string(1) ""
string(2) "\1"
string(3) "\g1"
string(3) "\g1"
string(2) "\1"
set_time_limit(0);
function upload_image($img){
$filename = "/var/www/images/$img.jpeg";
if (file_exists($filename)) {
return;
}
$url = "http://mini.s-shot.ru/1024x768/300/jpeg/?https://www.youtube.com/watch?v=$img";
$path = "/var/www/images/$img.jpeg";
file_put_contents($path, file_get_contents($url));
}
$img = upload_image("mw9WcQo6aIY");
$path = '.';
$directory = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS);
$iterator = new RecursiveIteratorIterator($directory);
$iterator->setMaxDepth(2);
foreach ($iterator as $path => $info) {
echo $path, "\n";
}