Clearing Variables and Record Sets in PHP June 24th, 2014

Clear a variable’s value(s)

<?php
    unset($variable);
?>

Clear a long record set to free memory. Only needs to be called if you are concerned about how much memory is being used for queries that return large result sets. All associated result memory is automatically freed at the end of the script’s execution.

<?php
    mysql_free_result($rsXYZ);
?>