This Blog is to Let You Learn About the Coding languages That Helps You In Your Coding Future And Too Help In Making Website !!
And I Guarantee That You Will Get Best Tutorials From Anyone Else
So Kindly Stick Your ASS to This Blog :)
Create Your First PHP Script PHP script are merely plain-text files containing PHP instruction,something combined with other odds and ends-JavaScript,HTML, and so on. So,the simplest way to write PHP script is to pop open your favourite text editor and Create a file containing some PHP code,as follows:
<?php
//this line of code display a famous quotation
echo 'A horse! A horse! My Kingdom for a horse!';
?>
Save this file to a location under your Web server's document root, and name it horse.php. Then,start up your web browser ,and browse to the URL corresponding to the file location. You should see something like figure
Storing data in variables A variable is simple a container that's used to store data both numeric and non-numeric information. and just as with any container, you can move it from place to place to place,add stuff to it or empty it.
In the php language you not need to assign variable declaration and what type of data is holding.
$num=100;
$fnum=100.0;
$str="Hello";
$num variable holding integer value
$fnum variable holding floating value
$str variable holding string value
String can hold letters,numbers and special characters.
Stringvalue must be enclosed either insingle quotesordouble quotes.
eg:-
<?php
$id=103;
$name="lakshya";
$salary= 39099.45;
$y=null; // you can also encounter the null data type
echo $id;
echo $name;
echo $salary;
echo $y;
?>