The result is: four. I couldn’t understand it at first. According to my understanding, the logic should be like this: e"/> The result is: four. I couldn’t understand it at first. According to my understanding, the logic should be like this: e">
Home >Backend Development >PHP Tutorial >photoshop cs5 official Chinese cracked version download instructions for using the ternary operator in php
Today a netizen posted a question in the group. It is not difficult, but it may be wrong.
Copy the code The code is as follows:
echo
$a == 1 ? 'one' :
$a == 2 ? 'two' :
$a == 3 ? 'three' :
$a == 4 ? 'foura' : 'other';
echo "n";