Showing posts with label php variable. Show all posts
Showing posts with label php variable. Show all posts

Sunday, March 3, 2024

PHP variable


PHP variable

PHP variable


1] variables are declared /represent with a dollar sign ($) by the variable name.

2] A variable is a container to store to add values() of

Type :-

1] int

2] float

3] string

4] boolean

5] array

6] object

7] resources etc.

3] Variable names must begin with a letter or underscore character, followed by any combination of letters, numbers, or underscores.

Rules Variable Declaration


1] variable name must start with any Alphabet or symbol , variable name.
2] Can not start with a number.
eg :- $s1 = correct , $1s = wrong

3] PHP variable name are case sensitive .
   EG- $a ,$A, are two different variables.

PHP variable
Program :-

<?php
$no1=10;
$no2=5;
echo $no1+$no2;
?>

PHP variable
Output :-

php variable /output



READ MORE


PHP introduction

PHP variable

PHP operators

PHP Data type

PHP logical operators

PHP Arithmetic Operators

PHP Assignment Operators

PHP string operators