Yes, there are more simple ways.
One way is:
PHP Code:
if ($newpm['messages'] >= 0 && $newpm['messages'] < 10 && $bbuserinfo['userid'] != 0) {
echo "You have $newpm['messages'] messages";
} elseif ($newpm['messages'] > 10) {
echo "You have 10+ messages";
} else {
echo "You are not logged in!!!";
If you wouldn't be using numbers, but for instance words for numbers, you would use a switch statement like:
PHP Code:
if ($bbuserinfo['userid'] != 0) {
echo "You are not logged in!!!";
}
switch ($newpm['messages']) {
case 0: $newpms="zero"; break;
case 1: $newpms="one"; break;
case 2: $newpms="two"; break;
case 3: $newpms="three"; break;
case 4: $newpms="four"; break;
default: $newpms="four plus";
}
echo "You have $newpms messages";