PHP and MYSQL Tutorials For Dynamic Websites - Variables

Опубликовано: 26 Октябрь 2024
на канале: Prewebsolution
11
3

In this lesson, I have teach about the basic syntax of PHP in these PHP and MYSQL tutorials. Followings are the important things about variables:

1- Basic convention of PHP variables are:
1.1 - It should start with a dollar sign $
1.2 - It should start with either a letter or a underscore
like $_name & $name
1.3 - It is case sensitive.
like $name and $Name are different php variables.

2- We can assign a value to a php variable using assignment operator (=).

3- We can print the values of php variables using any of these two methods:
3.1 - echo the variable name directly like echo $variablename;
3.2 - echo the variable name within double quotations like echo
"Hello, $variablename".

Things to remembers / PHP Variables Tips:
Donot write the variable name to be printed in single quotations it will not work in php.

For futhur details and Queries , contact us at [email protected] or +923316105976. Thanks in advance. Saad Tanvir (Prewebsoutions author).