ads
Wednesday, 9 March 2016
variables in PHP
PHP VARIABLES
All variables in PHP denoted by $ variables are designed with = operator with variable or left side & expression is right side.
Syntax:- $variablename=value;
eg:- $number=50;
Variables donot have types. A variable donot know in advance whether it will be use to store a nunber or string.
variable name start with letter and underscore.
A variable name can contain alpha numeric character and underscore(_)(A - Z).
All variables names are case sensitive.For eg:- $age and $Age both are different variables.
We donot have to tell PHP which datatype the variable is PHP automatically convert the variables to correct data type depend on its value in other language.Such as C,C++,Java. The programmer must declare the name & type of variable before using it.
Variables have a three types:-
Global variable
Local variable
Static variable
Introduction about PHP(comments,php files,syntax,echo and print)
PHP
PHP is a hypertext preprocessor . It is widely used for Open sorce scripting languae. PHP scripts are executed on server. PHP is a server side scripting language that is embedded in HTML. It is used to managed dynamic content and databases.
PHP Files
PHP file contain HTML,CSS,JavaScript. PHP codes are executing on server & result is return to browser as HTML.
PHP file have extension .php.
PHP can generate dynamic content.
PHP can create Open,write,delete,close file on server. PHP can collect form data. PHP can add, delete, modify data in database.
PHP can run on various platform like windows, linux, mac. PHP supports wide range of database.
Syntax of PHP:-
<?php
-------
?>
To Print any value
ECHO and PRINT is used. Echo is widely used than Print because echo is very fast than Print,therefore Print is less used.
<?php <?php
echo"Hello..."; print"Hello...";
?> ?>
Comments in PHP
Comments have a two types:-
Single line comment:- (# is used for single line comments. )
Multi-line comment
/*
----(for multi line comment)
*/
Monday, 7 March 2016
Tuesday, 1 March 2016
Monday, 29 February 2016
Sunday, 28 February 2016
Subscribe to:
Posts (Atom)