Page 1 of 1

clearing array from memory?

Posted: Fri Feb 24, 2006 2:49 pm
by s.dot
Is it possible to free any memory used by an array during script execution.... similar to mysql_free_result()?

Posted: Fri Feb 24, 2006 3:06 pm
by josh

Code: Select all

$array=NULL;
or

Code: Select all

unset($array);

Posted: Fri Feb 24, 2006 3:12 pm
by s.dot
very nice. thanks =]

Posted: Fri Feb 24, 2006 3:15 pm
by hawleyjr
If you are using the variable later on in the script I recommend doing:

Code: Select all

$myArray = array();
This way, you keep the variable of type array