<?php
function randomString($count = 5, $length = 15) {
$chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charsLen = strlen($chars);
$res = [];
for($i = 0; $i < $count; $i++) {
$tmp = '';
for ($j = 0; $j < $length; $j++) {
$tmp .= $chars[rand(0, $charsLen - 1)];
}
$res[] = $tmp;
}
return $res;
}
var_dump(randomString());
<?php foreach ($arItems as $key => $item):?>
<tr>
<td><?=$item['ID']?></td>
<td><?=$item['NAME']?></td>
<td><?=$item['PRICE']?></td>
<td><?= round(100 - ($item['DISCOUNT_PRICE'] / $item['PRICE'] * 100))?></td>
<td><? echo $item['AMOUNT'] != 0 ? $item['AMOUNT'] : 'Нет в наличии' ; ?></td>
<td><img src="/_images/<?=$key+1?>.jpg" alt=""></td>
</tr>
<?php endforeach;?>