+ 2
How to add comparaison operators in switch?
By comparaison operators I mean this: http://php.net/manual/en/language.operators.comparison.php I made a code: https://code.sololearn.com/wQRRXc0f1ePL/# but instead of adding the same echo for multiple cases, instead add something like <= 5 gives the same output. You understand? I tried writing <= 5 directly but the server gave me this error: ( ! ) Parse error: syntax error, unexpected '<=' (T_IS_SMALLER_OR_EQUAL) in C:\wamp64\www\tests\new_2.php on line 8 thanks in advance :D
3 Respostas
+ 1
Is it that you wanted?
https://code.sololearn.com/wB4Q59EC2W76/?ref=app
+ 2
@Sami Khan: Thankssss! 🤗 instead of writing ($note<=5) I was writing case <= 5!
perfect
+ 1
it's very logic try it yourself once if not tell me.