PHP variables
In PHP variables are used for storing the values, such as numbers, strings or function results so that they can be used many times in a script.
Variables in PHP:
1. Variables are used for storing values like text strings, numbers or arrays.
2.When a variable is set it can be used over and over again in your script.
3.A variable in PHP starts with a $ sign symbol.
4.The correct value way of setting a variable in PHP as follows
$var_name=value;
We can see the variable with a string, and a variable with a number.
<?php
$txt ="web designing company";
$number =10;
? >
Variable naming rules:
a. A variable name must start with a letter or an underscore "_".
b.A variable name can only contain alpha-numeric characters and underscores.
c. A variable name should not contain spaces.
No comments:
Post a Comment