Mega Code Archive

 
Categories / Php / Functions
 

Multiple return statements in a function

<? function payment_method($cash_on_hand, $amount) {     if ($amount > $cash_on_hand) {         return 'credit card';     } else {         return 'cash';     } } ?>