Showing posts with label php tutor. Show all posts
Showing posts with label php tutor. Show all posts

Friday, 16 January 2015

Want To Get Free Hosting Easily ?

Want To Get Free Hosting Easily ? - http://youtu.be/_enxiFSDp90


WEBSITE I USE : www.2freehosting.com
Want To Be A Knowledge Freak : www.phptutor.net.in/blog
...See More


Want To Get Free Hosting Easily ? -http://youtu.be/_enxiFSDp90 WEBSITE I USE :www.2freehosting.com Want To Be A Knowledge Freak : www.phptutor.net.in/blog ...
YOUTUBE.COM

Sunday, 11 January 2015

Create Your First PHP Script

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



USING VARIABLE AND OPERATORS

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.
String value must be enclosed either in single quotes or double 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;
?>