But still, you are required not to use a global var. It's all great in theory, but it's impractical. Why woudl you want to limit yourself?
I revert back to my previous post:
Brett wrote:Aren't PHP variables case sensitive? If so, wouldn't you be able to say all session vars have the format of lowercase, and all other vars have the first letter uppercased?
PHP Manual wrote: Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive.
Variable names follow the same rules as other labels in PHP. A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
Seems to me to be the best option if you're coding for all kinds of servers, and you need it to be compatible. Also, if you're only developing that app, then I'm sure you can go ahead and remember for the few months that you need to have uppercase variables, then your app would be perfectly fine.
Don't trust me (or the php manual)? Try this:
<?php
$var = 'A lowercase variable!!';
$Var = 'A variable with an uppercase!!';
$VAR = 'An all uppercase variable!!';
echo $var.'<br>'.$Var.'<br>'.$VAR;
?>
It outputs:
A lowercase variable!!
A variable with an uppercase!!
An all uppercase variable!!
Hope I can shed some light....
~Brett