PHP Variable

PHP Variable

The variable name must start with the dollar sign ($).
PHP variables are case-sensitive. It means that $age and $Age variables are entirely different.

The first character after the dollar sign ( $) must be a letter (a-z) or the underscore ( _ ).
The first character after dollar sign ($) can not be number.

A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )


Declaring PHP Variables

In PHP, a variable starts with the $ sign. PHP automatically associates a data type to the variable, depending on its value.

Syntax

$variableName = "";

example:
$friendName="Ravi";

See Output

Remember that PHP variable names are case-sensitive!


About Us

Comsysapp.com is an educational website. Students and software developers can learn programming language tutorials. Comsysapp is very useful for beginners and professional developers. Comsysapp provides tutorial in easy language. Comsysapp.com has focus on simplicity.

Services

Comsysapp.com provides free tutorials like c, html, css, etc. All tutorials are free for beginner and professionals.


Terms of Use

comsysapp.com is not responsible for any mistake. We are not responsible if information made available on our website is incomplete or invalid. But comsysapp.com always try for zero-zero mistake.

Privacy policy

comsysapp.com does not collect any data from users. We use Google AdSense advertising on our website. We never ask personal or private information.


Sitemap

sitemap

copyright © 2023