Wondering if it's possible to have a foreach loop call on if statement like this :
if (class_exists('WooCommerce')) {
foreach (array_combine($val1, $val2) as $key => $row_values)
}
else {
foreach ( $val1 as $key => $row_values )
}
{ begin of loop code
What I'm trying to do is to have a foreach loop if woocommerce plugin is active and to have another foreach loop if woocommerce isn't active.