PHP Variable Names
For years I thought PHP variable names could only be constructed from ASCII characters. Actually, maybe I had not really thought about it but rather just followed common practice without question. The common practice being something like a variable name is prefixed with $ the first character must be a letter (a-z, A-Z) or an underscore (_) subsequent characters can be any mix of letters or digits (0-9) or underscore So, examples of valid PHP variable names include $Andre $age $previous_total But!!!!! We are in the Unicode age and so variable names are NOT restricted to the above common practice. We can be much more creative. We can, for instance, localise our code. Examples of valid variable names include $André $小山 $エクセレント $우수한 $🐉 For the following explanation I am assuming your source code file is saved as Unicode UTF-8. If not, it should be. Letʼs refer to the the definitive ...