Saturday 11 July 2020

Variables in Php

                                         Variables

Variables are use to Store the value like Numeric,Characters,Strings.

We can say that "Variables is like a container . Which is store the Value.or Hold The Value"

Php Variables are Start With "$" Sign.

Some Important Things For Variables in Php 

We can create variables like that:

$ABC, $Abc, $abc, $_abc, $a_bc, $abc_1 

we can't create variable like that:
$12abc , $ abc

Example

<?php


     $a =1;
    $b=2;
    $c=$a+$b;
    echo $c;
  
?>

Comments in Php

                             Comments

Comments is not Execute in Php. It is part That new Developer can read it and Understand the Code.
Comment section Text Never Show On Browser During Execution.

There are Two Types of Php Comments :

1.  Single-Line Comments.
2. Multiple-Line Comments.

                                       Single Line Comments


<?php

// This is Single-Line Comments.
# This is Single-Line Comments.
echo "Hello World";


?>

By using Single-Line Comment We can Comment a single Statement.



                                          Multiple-Line Comments



<?php

/*
statement-1
statement-2
statement-3
.
..
.
.
*/
echo "Hello World";


?>

By using Multiple-Line Comment We can Comment Multiple Statement.

Easiley Embded With Html

<!DOCTYPE html>
<html>
<head>
<title>
Easiley Embded With Html
</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
</head>
<body>

<div class="Abc">
<?php  echo "Hello World"; ?>
</div>
</body>
</html>



Here You Can See php is Easiley Embded With html . 

Php First Programe

There are two Types of Php Tag
  1. <?php           (Open Tag)
  2. ?>                 (Close Tag)
                                             Start First Programe
    <?php

   echo "Hello World";



  ?>




Save This File any name with .php Extension.
Ex. a.php, b.php, c.php, abc.php, xyz.php etc.

"echo" is Php Predefine  Function , Which Show  output on the Browser. 
use semicolon (;) for Terminate the Statement.


Friday 10 July 2020

PHP


PHP Stands For "Php Hypertext Preprocessor". php used to making dynamic and interactive Web pages.

PHP is a server-side scripting language  just becouse of
Without Server php code could't be Run.


                How To Work In Php  and Important Tools.

Requirements for Php:
  1.    Server
  2.    Code Editior

                                         Server

      We can use different types of server 

  a)  XAMPP     (Windows Operating System)
  b) WAMP       (Windows Operating System)
  c)  MAMP       (Mac Operating System)
 d)  LAMP        (Linux Operating System)

                                    Code Editior


  Code Editior Means "Where You Can write Your Code"
   Which is
     a) Notepad  
     b) Notepad++
    c)  Sublime



I Have Work on Xampp Server  and Sublime.

Now Download And Install the xampp server as per Your System Requirment (36 or 64 bit OS)

I have Install Xampp Server in C drive

After Install The Server You can See The Directory



>> Go The location Where You Install The Xampp Serever 

       My  Server Location is c drive   




>>  Now Select Xampp Folder and Open




>>  Now  Selct htdoc  Folder and Open



    Here You Can Create Your Own Folder And Start Work

    I  have Create "projects" Folder To Work.
   
   In This Folder we can create a File and save this file with any name but extension is >  .php

  Example :      abc.php   , XYZ.php,  ak.php etc




    After That The Question arise  How We access This File

    Now You go to your XAMPP server and Start Apache and mysql 



    After That go the Browser and Type on url >  localhost/projects/index.php

      Now You Can see The Result on Browser.