Kez PHP at unset Can () birçok değişken?

4 Cevap 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.

Bu yüzden PHP daha sonra 1 öğe yoketmek mümkündür

Örnek:

<?PHP

unset($var1);

// could be like

unset($var1,$var2,$var3);

?>

4 Cevap

Evet.

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

void unset ( mixed $var [, mixed $var [, mixed $... ]] )

The PHP manual çok kullanışlı olabilir. Herhangi bir yerleşik fonksiyon aramak vb bu işlevi yapar ne çok ayrıntılı bir açıklama, almak ve cevap istediğiniz gibi evet, gibi birçok değişkenler ile unset sağlayabilmektedir olabilir.

Evet, PHP kılavuzu, bakınız Örnek 1:

http://us2.php.net/manual/en/function.unset.php

Ayrıca örneğin bakmak, herhangi bir PHP işlevini uzatabilirsiniz

function multiply_foo()
{
    foreach(func_get_args() AS $arg)
        foo($arg);
}

multiply_foo($arg1, $arg2, $arg3);

via PHP: func_get_args