Hi all
Hopefully a quick one.
Is there a way of getting this line:
$var == 1 ? 'Test1' : 'Test2'
To work with a range of numbers for $var instead of being explicitly a number 1?
i.e.
If $var could be either 1, 2 or 7 for example?
Thanks Doug
Use [man]in_array/man.
laserlight;11041415 wrote:Use [man]in_array/man.
Could you privide me with an example of how it would lookusing in_array?
Thanks you.
I would expect something along the lines of:
in_array($var, [1, 2, 7]) ? 'Test1' : 'Test2'