-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathage.php
More file actions
30 lines (27 loc) · 720 Bytes
/
age.php
File metadata and controls
30 lines (27 loc) · 720 Bytes
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
27
28
29
<?php
$fname = $argv[1];
$lines = file($fname);
foreach ($lines as $value) {
if ($value < 0 || $value > 100 ) {
echo 'This program is for humans';
} elseif ( $value <= 2 ) {
echo 'Still in Mama\'s arms';
} elseif ( $value <= 4 ){
echo 'Preschool Maniac';
} elseif ($value <= 11) {
echo 'Elementary school';
} elseif ($value <= 14) {
echo 'Middle school';
} elseif ($value <= 18) {
echo 'High school';
} elseif ($value <= 22) {
echo 'College';
} elseif ($value <= 65 ){
echo 'Working for the man';
} elseif ($value <= 100) {
echo 'The Golden Years';
}
echo PHP_EOL;
}
echo "";
?>