Jump to content

if($var=='1'or'2'or'3)?


neddy

Recommended Posts

hey

ive been using php for a while now but never needed this before (or even know if its possible)

so heres what i have..

[code]
if($var = 1) {
print $var." = 1";
}else{
print $var." doesnt = 1"
}
[/code]

i need to change it to

[code]
if($var = 1 or 2 or 3) {
....
[/code]

how do i go about doing that? i tried a few ways but couldnt figure it out, and couldnt find anything more complex then what i already have on any online tutorials...

cheers
Link to comment
https://forums.phpfreaks.com/topic/11779-ifvar1or2or3/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.