I am going to use mysqli_close($connection) to close the $connection. But Before Closing I need to ensure that the concerned connection is open.

I tried

if($connection)
{
  mysqli_close($connection);
}

But it is not working. Any Solution?

Edit
Report