Created
July 27, 2012 15:33
-
-
Save venomjke/3188697 to your computer and use it in GitHub Desktop.
Утилита для сканирования каталога и переброски файлов по заданному фильтру
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$path = "/home/y/yahoch/dommebeli.org.ru/public_html"; | |
$pathto = "/home/y/yahoch/mebelless.ru/public_html"; | |
function onlyjpg($var){ | |
global $path; | |
$file_info = pathinfo($path."/".$var); | |
return $file_info['extension'] == "jpeg" or $file_info['extension'] == "jpg"; | |
} | |
function movefiles($var){ | |
global $pathto; | |
global $path; | |
echo $var."<br/>"; | |
$file = file_get_contents($path."/".$var); | |
file_put_contents($pathto."/".$var,$file); | |
} | |
$images = array_filter(scandir($path),"onlyjpg"); // ﳡ鱠欠������array_walk($images,"movefiles"); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment