title: PHP can I leave a blank execution code for 'If"?
body: <p>I am writing a cart system, for this cart action, if selected item already in the cart, I want the the function to add nothing, so I leave it blank. Is it proper practice to do so? Or is there any professional way to do?</p>
  
  <pre><code>&lt;?PHP
  ...............
  
        // Is product already in cart? If so, add nothing.
        if(in_array($productName, array_keys($_SESSION["cart_item"]))) {
      // do nothing...........so leave it blank?
        } else {
          // Product is not in cart, but we have other products in cart.
          // So just add to existing cart array.
          $_SESSION['cart_item'] = array_merge($_SESSION['cart_item'],$itemArray);
        }
      }
  
      ?&gt;
  </code></pre>