Support the ongoing development of Laravel.io →
Views Blade Jobs
Last updated 1 year ago.
0

Doesn't work with the or statement. I will find out why later.

$var = 1;
echo ($var==1 ?  'true: ' : 'false');


$var = 1;
echo ($var==1 or $var ==0 ?  'true: ' : 'false');
Last updated 1 year ago.
0

seems to work if I use || instead of or.

$var = 1;
echo ($var==1 || $var ==0 ?  'true: ' : 'false');
Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.