PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $a=17; if ($a < 0 ) { if ($a % 2 === 1) { echo "$a is negative odd"; } else { echo "$a is negative even"; } } else { if ($a % 2 === 1) { echo "$a is positive odd"; } else { echo "$a is positive even"; } } function positive_or_negative($a) { return ($a < 0 ) ? 'negative' : 'positive'; } function odd_or_even($a) { return ($a % 2 === 1 ) ? 'odd' : 'even'; } echo "$a is " . positive_or_negative($a) . " " . odd_or_even($a);
Show:  
Copy Clear