Skip to content

Instantly share code, notes, and snippets.

@iredun
Created February 20, 2015 09:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iredun/8a218cf0f5a2a6b12568 to your computer and use it in GitHub Desktop.
Save iredun/8a218cf0f5a2a6b12568 to your computer and use it in GitHub Desktop.
Script scan photo on dir
<?
$patch=$_SERVER["DOCUMENT_ROOT"]."/bitrix/script foto/News foto/".$dt."/".$nub."/";
$source = str_replace($_SERVER["DOCUMENT_ROOT"], "/", $patch);
$f = scandir($patch);
foreach ($f as $file){
if (!(preg_match('/\.(jpg)/', $file) || preg_match('/\.(JPG)/', $file))) {
$key = array_search($file, $f);
if ($key !== false){
unset($f[$key]);
}
} else {
$html.='<a href="'.$source.''.$file.'" rel="lightbox[roadtrip]" ><img src="'.$source.'small/'.$file.'" border="0" /></a> ';
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment