php sword id slot count name Медный ска меч symbol time time time 3600

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<?php
$sword = [
'id' => 1,
'slot' => [1,2],
'count' => 1,
'name' => 'Медный, ска, меч',
'symbol' => '>',
'time' => [time(), time() - 3600]
];
foreach([1,2,3,4] as $slot=>$val){
echo (($slot%2)==0 ? '<br />'.($sword['slot'][$slot] == $val ? $sword['symbol'] : $val) : ($sword['slot'][$slot] == $val ? $sword['symbol'] : $val));
}