Dumb Variable Scope question (variable within {})
Posted: Sat May 24, 2008 2:17 pm
I can't access a variable defined within {} curely brackets, I know it's a scope issue though I didn't see anything on the variable.scope page on php.net. So a quick reminder on what I should do to access $theme variable below would be most helpful! I'm just setting some default values in the absolute certain situation that new visitors who have never been to my site have some preferences set (versus none).
Code: Select all
if (!isset($_COOKIE['settings']))
{
$theme = 'classic';
}
//Below does not echo anything, how can we change that?
echo $theme;