How to use more than 1 or 2 conditions in php if statements? -


this question has answer here:

i want output per condition, mentioned in code. have 3 more conditions, - medium, large, , large. these services. can mention 4 conditions @ time , output should relivent!

here code if statement :

if ($item['description'] == "small") {     $typeoutput = lang::trans('invoicessacsms').'<br />';     } 

please check code above, , suggest something. thanks

you can add switch cases different results:

switch ($item['description']) {     case 'small':         $typeoutput = lang::trans('invoicessacsms').'<br />';         break;     case 'medium':         # code...         break;     default:         # code...         break; } 

if results same can use multiple condition in if

if (($item['description'] == 'small') || ($item['description'] == 'medium')) { // use || or && depending upon requirement     $typeoutput = lang::trans('invoicessacsms').'<br />'; } 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -