var_dump($products);
Output: array(7) { [0]=> array(5) { ["Product"]=> array(40) { ["id"]=> string(3) "726" ["wbb"]=> string(1) "1" ["abb"]=> string(1) "0" }
But when I do var_dump($products['Product']['wbb']); it gives me NULL
How I will use the value of ["wbb"]
if(!empty($product)) :
If i dump $product, it gives me different products with details of each product.
Simple output of one product when I dump $product
array(7) { [0]=> array(5) { ["Product"]=> array(40) { ["id"]=> string(3) "726" ["wbb"]=> string(1) "1" ["abb"]=> string(1) "0" }
{ [1]=> array(5) { ["Product"]=> array(40) { ["id"]=> string(3) "727" ["wbb"]=> string(1) "0" ["abb"]=> string(1) "1" }
Similarly I have 10 more products with some of them are wbb = 1 and some of them are abb =1. I want to add tooltip according to the flag raised. But when I do like this $i++;
if(!empty($product[$i]['Product']['wbb'])){ echo code here.....}
becuase it iterates, so it will not give me according to exact product. How should I have to do it?
$productvariable come from? Do you foreach over your$products? Please share all relevant code, otherwise we can't help you!