mercredi 6 septembre 2017

stuck with getting two minimums of several variables

I'm pretty new to PHP, still learning, but I just cant get the solution.

I have 3 variables

$line1 = 5;
$line2 = 3;
$line3 = 7;

I need a hint on how to get the 2 lowest variables and IF the sum of those 2 variables is higher than the 3rd variable it should echo.

I'm guessing an if-else statement or switch, but im not sure.
But i'm mostly stuck on how to get the 2 minimums.

Anyone can help? Sorry, im still a noob xD

Aucun commentaire:

Enregistrer un commentaire