static $searchQuery="nothing";
if ($searchQuery=="nothing")
{
if ($referral=="")
{
$referral=referrer();
}
$searchQuery=getSearchQuery($referral);
}
return $searchQuery;
Basically I need to initialize $searchQuery with something.
I can initialize it with "" but the value of $searchQuery is often legitimately "".
So how should I initialize it? ""? Nil? Null? array()? What?
I can also use
static $result;
if (isset($result))
{
return $result;
}
but I got warning because $result is not defined.
staticfor starters.