This is my code
foreach($orders as $order) {
array_push($list, array($order['name'],$order['email'],$order['financial_status']));
}
Now i got the value of financial_status is 1, I want to get value as true. I want to add condition before the foreach loop.
Can anyone help me? Thanks in advance!.
You need this maybe:
foreach($orders as $order) {
if ($order['financial_status'] == 1){
$financial_status = true;
} else {
$financial_status = false;
}
array_push($list, array($order['name'],$order['email'],$financial_status));
}
It will put boolean in array.
foreach($orders as $order) {
if ($order['financial_status'] == 1){
return true
} else {
return false
}
array_push($list, array($order['name'],$order['email'],$financial_status));
}
check this edit make sure to comparing with financial_status in table if you want financial_status to return true when its value is 1 in sql and if true value required to be a different value change ==1 to that value