Powered by Blogger.

Different Between Double Quote & Single Quote

Monday, 14 July 2014

Different Between Double Quote & Single Quote :-

echo Function into Single Quote  into the print value of Variables And it is not possible into the Double Quote.

Syntax :-

<?php 
     echo '$variable_name';
     echo "$variable_name";
?>

  • Above Syntax into the Second Statement Into Generate the Error because the double quote into not print the value of variable.

Example :-

<?php 
     $a=555;
     echo 'Value of the Variable $a';
     echo "Value of the Variable $a";
?>

Concatation in Php

Concatation in Php :-


You have Concatation in php Using the Dot(.) Sign.

Syntax :-

      echo "String Message".$Variable_name;

  • Above Syntax into Display the Concatation between String and Variable .
Example :-

<?php

      $a=66;
      echo "Value of the A Variable : ".$a;

?>

How to Create a Variable in Php and Print

How to Create a Variable in Php :-


You have Create a Variable in Php Using the "$" Sign.

Rules of Variables is Following Listout.

  1. Variable Name Must be Start with a letter (a,b,c........) or underscore (_).
  2. Variable Name Length is Maximum 32 Character.
  3. Variable Name is the Case Sensitive.
  4. Variable Name into Contain the Alpha-Numeric Character and Underscore.

Syntax of Create Variable :-

        $Variable_name=Value;

Example 1 :-


<?php
      $a=3;
      echo $a;
?>

Example 2 :-


<?php
      $a=3;
      $b=5
      echo $a+$b;
?>

Print Hello World in Php

Print Hello in Php :-


Print Hello World Using the echo Function in Php.

Syntax of echo Function :-

         echo "String Message";


Example :


<?php
          echo "Hello World";
?>

Introduction Of PHP

Introduction :-

  • Php Old Name is the Personal Home Page.
  • Php New Name is the Hypertext Pre-Processor.
  • Php is Developed By Rasmus Lerdorf in 1994.
  • Php is the Server-Side Scripting Language.
  • Php Through You have create Dynamic Webpage.
  • Php Run on the Apache Web Server Like wamp,xampp etc...
  • Php Support many Database Like as Mysql,MSsql server etc...

Syntax Of Php :-

Old Syntax

<?......
.........
.........
?>

New Syntax

<?php....
.............
............
?>