-2

Is it right way for check $orderstatus value??

if($orderstatus == Refund || Cancel){

            }

i want to if orderstatus is refund or cancle then and then only go to if condition.

Kevin Patel
  • 101
  • 1
  • 10
  • Possible duplicate of [PHP If Statement with Multiple Conditions](http://stackoverflow.com/questions/5593512/php-if-statement-with-multiple-conditions) – Criesto Nov 05 '15 at 09:59

2 Answers2

1

Try

if($orderstatus == 'Refund' || $orderstatus == 'Cancel'){
    //got here
}

This checks for either condition.

Also, I added quotes around the Refund and cancel values because they are strings.

user2959229
  • 1,360
  • 2
  • 11
  • 21
0

you can use also in_array

if($orderstatus == 'Refund' || $orderstatus == 'Cancel'){

}

or

if (in_array($orderstatus, array('Refund', 'Cancel'))) {

}
Osama Jetawe
  • 2,697
  • 6
  • 24
  • 40