Most otherwise usefull notes on this page use a now deprected function
<?php
curl_close($ch);
?>
This is no longer needed as the connection will close when the object is garbage collected. To explicitly close the curl handle unset the variable;
<?php
unset($ch);
// or
$ch = null;
?>