if($number % 15 == 0) { echo "BY3 AND 5"; } elseif ($number % 5 == 0) { echo "BY5"; } elseif ($number % 3 == 0) { echo "BY3"; }