PHP uses ternary function to determine the parity of the number of errors, how to solve
Parse error:syntax error, unexpected ' echo ' (T_echo) in F:\xampp\htdocs\test\test02.php on line 26 This is the error description,
Here is the source code:
for ($a =0; $a <10; $a + +) {
With the ternary operation output, if no remainder is an even number,
Otherwise an odd number
echo $a%2==0? $a. " is an even number "." \ n ": $a." is an odd number "." \ n ";
}
?>
------to solve the idea----------------------
Otherwise an odd number
------to solve the idea----------------------
for ($a =0; $a <10; $a + +) {
Output with ternary operation, if no remainder is an even number, otherwise an odd number
echo $a%2==0? $a. " is an even number "." \ n ": $a." is an odd number "." \ n ";
}
------to solve the idea----------------------
for ($a =0; $a <10; $a + +) {
With the ternary operation output, if no remainder is an even number,
Otherwise an odd number
}