PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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).
global $theme; // Set the variable as global to the current scope
if (!isset($_COOKIE['settings']))
{
$theme = 'classic';
}
//Below does not echo anything, how can we change that?
echo $theme;