PHP 8.5.0 Alpha 1 available for testing

Voting

: eight plus zero?
(Example: nine)

The Note You're Voting On

warhog at warhog dot net
21 years ago
you may wan't to unset all variables which are defined, here's one way:

<?php

function unset_all_vars($a)
{ foreach(
$a as $key => $val)
{ unset(
$GLOBALS[$key]); }
return
serialize($a); }

unset_all_vars(get_defined_vars());

?>

you can also save than a serialized var of the "memory" and perhaps store this in a temporary file.. very usefull if you work with text files and/or file uploads when you've got very large variables.

greetz

<< Back to user notes page

To Top