title: How to Check Whether mysqli connection is open before closing it
body: <p>I am going to use <code>mysqli_close($connection)</code> to close the <code>$connection</code>. But Before Closing I need to ensure that the concerned connection is open.</p>
  
  <p>I tried</p>
  
  <pre><code>if($connection)
  {
    mysqli_close($connection);
  }
  </code></pre>
  
  <p>But it is not working. Any Solution?</p>