Home >> PHP >> What are the rules for naming a variable in PHP

What are the rules for naming a variable in PHP

The following rules are needed to be naming a PHP variable:

1)-Variable names must begin with a letter or underscore character.
2)-A variable name can consist of numbers, letters, underscores but you cannot use characters like + , – , % , ( , ) . & , etc.

Post Your Comment

Next Questions
How can you compare objects
Some of the popular frameworks
How to concatenate two strings
How to encrypt password

Copyright ©2022 coderraj.com. All Rights Reserved.