Uses Of PHP
The following uses of php are as :-
1) PHP perform many system function like:- create,open, read, write and close.
2) PHP maintain form means, retrive data, send data, etc.
3) Using PHP you can add, delete, update information from database.
4) Using PHP you can access cookies variable and set cookies.
5) Using PHP you can encrypt data.
Hello World In PHP
The Hello World program in php as:
<html>
<head>
<title> Hello World Program </title>
</head>
<body>
<?php
echo " Hello World ";
?>
</body>
</html
PHP Is Case Sensitive
The php is case sensitive language. For Example :-
<html>
<head>
<title> Example to show php is case sensitive</title>
</head>
<body>
<?php
$value = 55;
print("Value is = $value<br>");
print("value is = $Value<br>");
?>
</body>
</html>
OUTPUT :
Value is = 55
value is =
PHP Data Type
In php there are many data type which are as follow:
1) Integer : - Integer are number Like : - 255, 34, etc. Integer are not a decimal value.
2) Double : - Double are float number or decimal value Like : - 3.4, 12.5, etc.
3) Boolean : - Boolean values are either True or False.
4) Null : - In php null is the special type of data type whose value is only Null.
5) String : - String in php are sequence of characters Like:- " Ram is good boy ".
6) Array : - In php array are the indexed and name collection of vlaue.
7) Object : - In php object are the instance of variabe. Object are the run time entity.
8) Resources : - Resources are special type of data type that hold reference to resource.
PHP Variables
In php variabel are container where value can be store.
eg. : - $var = 56;
Types of Variable are : -
1) Local Variable
2) Global Variable
3) Static Variable
4) Function Parameters
Variable Naming : -
The following rules for naming variable :
- Variable name must start with letter or underscore.
- Variable consist of number, letters, underscore.
- There is no size limit for variable.
- Variable name must start with $ sign.
eg. : $var = 45;
PHP Constant
In php constant are the name or an identifier for a value. A constant value cannot change during the execution of script. A constant is case-sensitive. Constant identifiers are always in uppercase. A constant name must starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
For use a constant you have to use define() function and to retrieve the value of a constant, simply you specifying its name. Unlike with variables, you do not use to have a constant with a $ sign.
Please comment for any query.
THANK YOU
0 Comments
Please share your comment through blog