var re = new RegExp('(\\d+\.?\\d+%)', 'g');
"If 43 is after a 999.99% reduction, then it was"
.replace( re, '<mark>$1</mark>')
/*
If 43 is after a <mark>999.99%</mark> reduction, then it was
*/
$stock = [
["id"=>1, "ver"=>13, "name"=>"gta v"],
["id"=>2, "ver"=>48, "name"=>"gta sa"],
["id"=>3, "ver"=>119, "name"=>"chess"],
];
$total = 0;
foreach($stock as $v) $total += $v["ver"];
$rnd = rand(1, $total);
$run = 0;
foreach($stock as $v) {
$run += $v["ver"];
if( $rnd <= $run) break;
}
$prizeName = $v["name"];
И как связана работа конденсаторов с ТТЛ в динамическом режиме работы устройства?