php users array array name Ayni age 18 array name Zhumarin age 17 tota

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
<?php
$users = array(
array('name' => 'Ayni', 'age' => 18),
array('name' => 'Zhumarin', 'age' => 17)
);
$total_users = count($users);
echo "Всего юзеров: ".$total_users."\n";
for ($i = 0; $i < $total_users; ++$i) {
if ($users[$i]['age'] < 18)
echo "малолетко :3\n";
else
echo "мелкая многолетко :3\n";
echo "name: ".$users[$i]['name']."\n";
echo "age: ".$users[$i]['age']."\n";
}