just wondering how can make possible in php if can or there better way great :d
with arrays , if statements
(i dont know else write saying looks post code; please add more details.)
<?php $products = array( 0 => array( "product_name" => "necklace", "product_price" => 10, "quantity" => 2, "handmade" => "true" ), array( "product_name" => "bracelet", "product_price" => 17, "quantity" => 1, "handmade" => "false" ), array( "product_name" => "handthingy", "product_price" => 6, "quantity" => 3, "handmade" => "true" ) ); <?php echo $product['handmade']; if('handmade'== true){ //do } else { //do }
i think looking foreach loop:
foreach($products $product){ if($product['handmade'] === 'true'){ //do } else { //do } } this iterate through items in product array, , check each 1 see if handmade. if not trying do, give more information.
Comments
Post a Comment