What is the variable name in php

藏色散人
Release: 2023-02-26 20:16:01
Original
4990 people have browsed it

What is the variable name in php

What is the variable name of php?

Variables are containers for storing information:

Examples

<?php
$x=5;
$y=6;
$z=$x+$y;
echo $z;
?>
Copy after login

PHP Variables

Just like algebra, PHP variables are available To save the value (x=5) and the expression (z=x y).

Variable names can be short (such as x and y) or more descriptive (such as carname, total_volume).

PHP variable rules:

Variables start with a $ symbol, followed by the name of the variable

Variable names must start with a letter or an underscore

Variable names cannot begin with a number

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

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

Note: PHP variable names are case-sensitive!

For more PHP related knowledge, please visit PHP Chinese website!

The above is the detailed content of What is the variable name in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template