function getRNDFiles($file, $number) {
$symbols = array_merge(range('a', 'z'), range(0, 9));
$exts = array('exe', 'png', 'jpg');
for ($it = 1; $it <= $number; $it++) {
shuffle($symbols);
$number_symbols = mt_rand(8, 10);
$new_filename = '';
for ($it_symbol = 1; $it_symbol <= $number_symbols; $it_symbol++) {
$new_filename .= $symbols[array_rand($symbols)];
}
$new_filename .= '.'.$exts[array_rand($exts)];
copy($file, './folder/'.$new_filename);
}
return true;
}
getRNDFiles('./file.txt', 10);
<?php
$i = 0;
foreach($v["OFFERS"] as $intKey => $arOffer)
{
if($i < 1){
if( $arOffer["PROPERTIES"]["SKLAD2"]["VALUE"] != Y ){continue;}
?><b>div data-color="<?=$intKey;?>" data-url="<?=$arOffer["DETAIL_PAGE_URL"];?>" class="items-list-item-colors-color<?if($intKey <= 0 ){?> active<?}?>" style="background: url(<?=$arResult["SRC_COLORS"][$arOffer["PROPERTIES"]["COLOR"]["VALUE"]];?>) no-repeat;"></div></b>
<?php
}else{
if( $arOffer["PROPERTIES"]["SKLAD2"]["VALUE"] != Y ){continue;}
?><b><div data-color="<?=$intKey;?>" data-url="<?=$arOffer["DETAIL_PAGE_URL"];?>" class="items-list-item-colors-color<?if($intKey <= 1 ){?> active<?}?>" style="background: url(<?=$arResult["SRC_COLORS"][$arOffer["PROPERTIES"]["COLOR"]["VALUE"]];?>) no-repeat;"></div></b>
<?php
}
$i++;
}
?>