I need to create a var like $myvar-test; but thats not valid or?
I need to create a var like $myvar-test; but thats not valid or?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, it’s not valid. The reason is the minus sign (-). In PHP, variables can contain 0-9a-zA-Z_ with the exception that it must not begin with a number and Unicode letters are allowed. See: http://www.php.net/manual/en/language.variables.basics.php
And a couple of examples: