Maybe Atomiku code is easier to understand,
and sure it will work perfect.
But a slightly changed code could be this:
<?php
if ( $replies < 15) {
$ranking = 'School Boy';
}
elseif ( $replies < 46) {
$ranking = 'Middle Group';
}
else {
$ranking = 'Older People';
}
?>
I also noticed in original topic, your code write '15' instead of just number 15
'15' is a string of 2 characters, a text to read
while
15 is a number, a quantity, representing not a string, but the number of 15 exemplars of something
XV - is another way to specify the number of 15
Now php is very forgiving for this, so it will work with or without quotes around 15.
Because PHP is smart enough to figure out you mean a number of years !!!!
🙂