The use of the static $var in this function works, but I'm wondering if there's a more efficient way to handle a situation like this.
function static_test() {
static $var = FALSE;
if ( ! $var) $var = date('Ymd');
// do some stuff with $var
}
I wondered if possible to do something closer to this... or other to declare the static $var.
function static_test() {
static $var = date('Ymd');
// do some stuff with $var
}
How would you do it?