What variable names can I use?
Posted: Thu Jun 15, 2006 5:37 pm
Can I use PHP with a variable name of ~? This is for a live site so I don't want to mess around with it !
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
The 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. As a regular expression, it would be expressed thus: '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
- Note: For our purposes here, a letter is a-z, A-Z, and the ASCII characters from 127 through 255 (0x7f-0xff).
Yes. Use apache's mod_rewrite or set the query_string_separator in php.ini.tecktalkcm0391 wrote:Well if I had a page url of
page.php/~variable
could I use $_GET[''] to get the ~variable and then take of the ~
Will it still work if the url isUse apache's mod_rewrite or set the query_string_separator in php.ini.
no.tecktalkcm0391 wrote:What happens if I don't do:
Will it still work if the url isUse apache's mod_rewrite or set the query_string_separator in php.ini.
page.php?~jdaflkdsjl
the $_GET['~']; would work?