How to use more than 1 or 2 conditions in php if statements? -
this question has answer here:
- if statement multiple condition in php 3 answers
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
Post a Comment