What do the variables in php start with?

(*-*)浩
Release: 2023-02-23 17:50:02
Original
11055 people have browsed it

What do the variables in php start with?

All variables in PHP start with "$"

$a=5; $b=6
Copy after login

php variable naming rules(recommended Learning:PHP programming from entry to proficiency)

1. Case sensitive

$A and $a$ are two different variables, (system built-in structure and Keywords, user-defined class and function names are case-sensitive).

2. The variable starts with the $ symbol, followed by the name of the variable.

3. Variable names must start with letters or underscores and cannot start with numbers.

4. Variable names can only contain alphanumeric characters and underscores (A-z, 0-9 and _)

If the variable is composed of letters, all lowercase is usually used as the variable name. If the variable is made up of multiple characters, use all lowercase letters for the first letter and capitalize each subsequent letter.

The following variable naming is correct:

Copy after login

The above is the detailed content of What do the variables in php start with?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!