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.
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.
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.
you can use also in_array
if($orderstatus == 'Refund' || $orderstatus == 'Cancel'){
}
or
if (in_array($orderstatus, array('Refund', 'Cancel'))) {
}