dimanche 27 mai 2018

If goes on true and false in the same time

I have an if statement.On true i have a die function with the message "its working" and on false a die function with message "no its not".

The problem is that, the function goes on true and it's printing the message "its working" but if i comment the die from true it will go on false and it will display "no its not".

Code:

if(substr($cart_item['id'],0,1) != "M") {
                $resp = $this->order_model->check_normal_product($cart_item['id']);
                if ($resp != null || !(empty($resp))) {
                    if (strcmp($resp['product_name'],$cart_item['name']) == 0 && $resp['price'] == ($cart_item['subtotal'] / $cart_item['qty'])) {
                        die('its working');
                    }else{
                        die('no its not');
                    }
                }
            }

Aucun commentaire:

Enregistrer un commentaire