welcome to tutorialfamily

php variable

Php variable – It is use to store value.

Variable is symbol or name.


php variable

php variable is symbol or name and use for store string, number, value. We do not need to declare variable before adding the value. php is automatically get variable value which is we have declared. in variable we can add value such as numeric value, string, addresses.

php variable is start with $ sign.

php variable cant start with number.

It is must be start with letter or underscore (_).

php variable cannot contain spaces.

$_SERVER Environment variable

It is use for get server information and https connection.

$_GET Environment variable

It is use for get information from the server by sending query by search url.

$_POST Environment variable

It is use for sent information from the client to server by using form.

$_ENV Environment variable

It is use for environmental variable.

$_COOKIE Environment variable

It is use for sent cookies data from the client to server.

$_FILE Environment variable

It is use for file information which is uploaded on the server.


variable



<!DOCTYPE html>
<html>
<head>
	<title>variable example</title>
</head>
<body>
<?php	
	$x = 24;
        $y = 26;
	$z  = $x + $y;
	echo "The template have color cobination is :".$z;	
?>
</body>
</html>

string



<!DOCTYPE html>
<html>
<head>
	<title>string example</title>
</head>
<body>
<?php	
	$a = 'Apple';
	$b = 'Banana';
	echo "My favourite fruit is ".$a;	
?>
</body>
</html>

output

Our Content