I want to create function like this. please help me to complete my function
if both are +ve
$a = 10;
$b = 6;
// do nothing just show same value 10 and 6
// if $b is negetive
$a = 10;
$b = -3;
// get the value from $a show the value 7 (10 - 3)
// 0 if $a is negative
$a = -2;
$b = 6;
// (little bit diffrent) get the double form $b of negative value and
// show the value 0 and 2(6-4)
i have tried with this but totally stopped at else code
// $a = something;
// $b = something;
if ($a >0 && $b >0) {
echo $a.' , '.$b;
}else{
// what? what? what?
}
Something along the lines of
Looks a bit homeworky though