What is PHP?
PHP = 'Hypertext Preprocessor'.
PHP started out as a set of tools for doing simple web-related tasks. It appeared
on the Web scene way back in 1994. Initially, PHP did nothing more than just track
visits to a particular web page (the online resume of Rasmus Lerdorf-the inventor
of PHP). It was then expanded to interact with databases, as well as provide a tool
set for online guest books and HTML form processing. The next thing you know, it
was hugely popular as an alternative to less web-friendly languages like C.
New versions of PHP started coming out, and an increasing number of web programmers
adopted it as their scripting language of choice for web tasks. PHP 3, 4,
and now 5 are now mainstays on the Web. PHP has become fast while remaining
lightweight. And, of course, its ability to easily interact with databases such as MySQL
remains one of its most attractive features.
What does PHP stands for?
PHP is an acronym. Originally, it stood for Personal Home Page
Construction Kit, because lots of programmers used it to build
their websites, going much further than what was possible with
HTML, CSS, and JavaScript. But in the last few years, "personal
home page" tends to sound more like something that happens
on one of those really cheap hosting sites, rather than a highpowered
programming language.
So now, PHP stands for PHP: Hypertext Preprocessor. If that
sounds geeky, it is. In fact, it's a bit of a programmer joke: PHP
stands for something that actually contains PHP within itself.
That makes it a recursive acronym, meaning that it references
itself. You don't have to know what a recursive acronym is;
that won't be on the quiz. Just be warned that PHP's recursive
acronym won't be the last weird and slightly funny thing you'll
run across in the PHP language.
PHP Advantages
-Exceptionally short learning curve
-Quick development time
-Very high performance
-supports all major platforms (UNIX, Windows and even mainframes).
-Features native support for most popular databases
Prerequisites:
-Should have a basic knowledge of html and css
-Download xampp or wamp servers:
link for xampp
Xampp Server
link for wamp
Wamp Server
Syantax with Example
Comments in PHP
// C++ and Java-style comment
# Shell-style comments
/* C-style comments
These can span multiple lines */
PHP Variables
*PHP variables must begin with a “$” sign
-Case-sensitive ($Foo != $foo != $fOo)
-Global and locally-scoped variables
-Global variables can be used anywhere
    -Local variables restricted to a function or class
-Certain variable names reserved by PHP
    -Form variables ($_POST, $_GET)
    -Server variables ($_SERVER)
Operators
Arithmetic Operators: +, -, *,/ , %, ++, --
Assignment Operators: =, +=, -=, *=, /=, %=
Comparison Operators: ==, !=, >, <, >=, <=
Logical Operators: &&, ||, !
String Operators: . and .= (for string concatenation)
Example
Example Is the same as
x+=y x=x+y
x-=y x=x-y
x*=y x=x*y
x/=y x=x/y
x%=y x=x%y