ads

Wednesday, 9 March 2016

STATIC VARIABLES IN PHP

STATIC VARIABLES IN PHP

"When function is completed and executed all of its variables are deleted. Sometimes we want a local variable not to be deleted we need it for further we to do this static keyword when you first declare the variable."

PROGRAM:-

















 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Output:-

DIFFERENCE BETWEEN LOCAL AND GLOBAL VARIABLES IN PHP

LOCAL AND GLOBAL VARIABLES IN PHP

1.PROGRAM:-


OUTPUT:-

 

 

 

 

 

 

 

 

 

2.PROGRAM:-

Output:-

Local variables in PHP

LOCAL VARIABLES


"A variable declare an inside a function has a local variable and can only accessed inside a function."

1.PROGRAM:- 













Output:-








 



Programs of Global Variables in PHP

Global variables

"A variable  declare an outside a function has a global and can only be accessed outside a function."

  1. PROGRAM:- 



Output:-

2.Program:-











































Output:-

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(variable and keywords case sensitivity)

PHP CASE SENSITIVITY


In a PHP all keywords are(If-else,while,echo,class,function,user defined functions) not case sensitive.
To run a PHP programs we need  a wampserver or etc.

Input:-




Output:-



 

NOTE:-"All variable names are case sensitive."

Input:-


Output:-

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

find leap year by using javscript and html

javascript

"leap year" 

Input:- To find a leap year or not.

Output:-

Step 1. "enter any leap  year..."

 Step 2. "click on submit button". This is a final output:-

 


 2nd time

  Step 1. "enter non-leap year..."

 

 Step2:- "click on submit button"then final output is :-



 

Monday, 29 February 2016

border properties in internal css

Internal CSS

"border-properties"

Input:- 












Output:-

border properties in internal css

Internal CSS

"border-properties"

  • border-width: value;  (value = thin,thick,medium)

  •  border-color: value; (value= red , green , pink etc.)

  • border-style:value; (value= solid , dotted , dashed , double)

Input:- 

Output:-


word-spacing in inline css

Inline css

"word-spacing"

Input:- word spacing using px and em.

  Output:-


letter-spacing in inline css

Inline Css

"letter-spacing"

Input:-letter spacing using px and em.


Output:-


Line-Height property in inline css

Inline css

"line height property"

Input:- without usingline height property.

Output:-

Input:- by using  line-height property in "px".

Output:-

















Input:-by using  line-height property in "%".


 Output:-


text properties in inline css by using HTML

Inline css

"text properties"

Input:-

Output:-

Sunday, 28 February 2016