function isEqual($number1, $number2, $sum){
$total = $number1 + $number2;
if ($total = $sum){
return true;
}
else {
return false;
}
}
if (isEqual(5,5,8)){
echo 'Sum!';
}
else {
echo 'No sum!';
}
PHP
My homework assignment says the if-clause is supposed to be just like that. So when $total is NOT equal to $sum it's supposed to say: No sum!.
The thing is I shouldn't change the if, I have to change something in my function because it's always saying 'Sum!' right now.
Can someone help me with this? It's not supposed to be difficult but I can't find it on google.