Basics of PHP

In 1994 when Rasmus Lerdorf put together a bunch of Perl scripts to track down who was looking at his resume. Little by little, people started to get interested in the scripts, and they were later released as a package “Personal Home Page” tools (the first meaning of PHP). In view of the interest, he wrote a scripting engine and incorporated another tool to parse input from HTML forms: FI, Form Interpreter, thus creating what was called variously PHP/FI or PHP2. This was done around mid 1995.

The PHP echo command produces output (the string “Hi, Educatesquare!”) which is inserted into the HTML file

PHP (PHP Hypertext Preprocessor) is an open source web scripting language that is especially suited for Web development and can be embedded into HTML. It is a server side scripting language.

PHP can be used in three primary ways:
• Server-side scripting
PHP was originally designed to create dynamic web content, and it is still best suited for that task. To generate HTML, you need the PHP parser and a web server to send the documents. Lately, PHP has also become popular for generating XML documents, graphics, Flash animations, PDF files, and more.
• Command-line scripting
PHP can run scripts from the command line, much like Perl, awk, or the Unix shell. You might use the command-line scripts for system administration tasks, such as backup and log parsing.
• Client-side GUI applications
Using PHP-GTK , you can write full-blown, cross-platform GUI applications in PHP.

Data Types:
PHP provides eight types data types.
Four are scalar (single-value) types:
• Integers,
• Floating-point numbers
• Strings
• Booleans
Compound (collection) types:
• Arrays
• Objects
Special types:
• Resource
• NULL

Escape sequence Character representation
\”———————-Double quotes
\n———————-Newline
\r———————-Carriage return
\t———————-Tab
\\———————-Backslash
\$———————-Dollar sign
\{ ———————Left brace
\}———————-Right brace
\[———————-Left bracket
\]———————-Right bracket
\0 through \777———ASCII character represented by octal value
\x0 through \xFF——–ASCII character represented by hex value