JasonDavis JasonDavis - 1 year ago 73
PHP Question

Can you unset() many variables at once in PHP?

I have a pretty high traffic social network site,

I would like to get into the habit of unsetting large array and mysql object and even some string variables.

So is it possible to unset more then 1 item in PHP




// could be like



Answer Source


Your example will work just as you imagine. The method signature for unset() is as follows:

void unset ( mixed $var [, mixed $var [, mixed $... ]] )
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download