how can i compare multiple data using php
for example i have a variable $foo , the data assigned to it varies . if there are four different data can be assigned to variable $foo , like :" car , van,bus or bicycle"
how can i use the if statement to check which data is assigned to $foo?
normally if i have two data i will use
if($foo == 'firstdata'){
//execute something as this is the first data
}
else{
//this is the second data!
}
if there's 3 data i will use elseif statement.
but now 4 data , what can i use ? or can i use elseif as many times as i want??