php header Content-type text html charset UTF-8 users array array name

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
header("Content-type: text/html; charset=UTF-8");
$users = array(
array('name' => 'Ayni', 'age' => 18, 'sex' => 'female'),
array('name' => 'Zhumarin', 'age' => 17, 'sex' => 'male')
);
$examin_age = count($users);
echo "юзеры:". $examin_age. "\n";
$total_users = count($users);
echo "Всего юзеров: ".$total_users."\n";
for ($i = 0; $i < $total_users; ++$i)
{
if ($users[$i]['age'] >= 18)
{
if ( $users[$i]['sex'] == 'female')echo "взрослая девушка:3 ";
else echo "взрослый мальчик:3 ", "\n";
}
else
if ( $users[$i]['sex'] == 'female')echo "маленькая девочка:ах";
else echo "маленький мальчик :Р", "\n";
echo $users[$i]['name'], "\n";
echo $users[$i]['age'], "\n";
}?>