Get the App
SLTechnology News&Howtos  ›  Development  › 

Should the php variable be capitalized?

Shulou Source: shulou.com Published: 2022-06-02 07:21:36 10月02日 Update

This article introduces the knowledge of "should php variables be capitalized?". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Php variables can be capitalized, PHP variable rules include: 1, the variable to start with the $symbol, followed by the name of the variable; 2, the variable name must start with letters or underscore characters; 3, the variable name can only contain alphanumeric and underscore; 4, the variable name can not contain spaces; 5, the variable name is case-sensitive.

This article operating environment: Windows7 system, PHP7.4 version, Dell G3 computer.

Can't php variables be capitalized?

Php variables can be used in uppercase.

Variables can be short names, such as x and y, or more descriptive names, such as age, carname, totalvolume.

Variables are "containers" used to store information.

PHP variable rules:

The variable begins with the $symbol, followed by the name of the variable

Variable names must start with a letter or an underscore character

Variable names can only contain letters, numbers, and underscores (Amurz, 0-9, and _)

Variable names cannot contain spaces

Variable names are case-sensitive ($y and $Y are two different variables)

This is the end of the content of "php variables should be capitalized". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Variables capitals underscores names letters content size characters numbers more knowledge spaces symbols rules followed different practical learned next two Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker macOS vpn MariaDB Microsoft