Saturday, August 16, 2014

Data Types in PHP

uPHP supports eight primitive types.

uFour scalar types:

uboolean
uinteger
ufloating-point number (float)
ustring

uTwo compound types:

uarray
uobject

uAnd finally two special types:

uresource

uNULL

Comments in PHP


// C++ and Java-style comment


# Shell-style comments


/* C-style comments
     These can span multiple lines */

Web application lifecycle


PHP Features

uOpen source / Free software.
uCross Platform to develop, to deploy, and to use.
uPower,Robust, Scalable.
uWeb development specific.
uCan be Object Oriented.
uIt is faster to code and faster to execute.
uLarge, active developer community.
u20 million websites
uSupport for PHP is free.

uGreat documentation in many language www.php.net/docs.php

Brief History of PHP

u     PHP (PHP: Hypertext Preprocessor) was created by Rasmus Lerdorf in 1994. It was initially developed for HTTP usage logging and server-side form generation in Unix
u     PHP 2 (1995) transformed the language into a Server-side embedded scripting language. Added database support, file uploads, variables, arrays, recursive functions, conditionals, iteration, regular expressions, etc.
u     PHP 3 (1998) added support for ODBC data sources, multiple platform support, email protocols (SNMP,IMAP), and new parser written by Zeev Suraski and Andi Gutmans .
u     PHP 4 (2000) became an independent component of the web server for added efficiency. The parser was renamed the Zend Engine. Many security features were added.
u    PHP 5 (2004) adds Zend Engine II with object oriented programming, robust XML support using the libxml2 library, SOAP extension for interoperability with Web Services, SQLite has been bundled with PHP 

PHP Architecture

  uZend engine as parser (Andi Gutmans and  
      Zeev Suraski)
 uSAPI is a web server abstraction layer
 uPHP components now self contained 
      (ODBC, Java, LDAP, etc.)

 uThis structure is a good general design  
      for software (compare to OSI model,          and middleware applications).

What is PHP?

u"PHP Hypertext Preprocessor"
uScripting Server-Side language
uCreation of dynamic content – i.e. HTML and JSON
uInteraction with databases (CRUDs)
uServer side, or via command line (CLI)
uCan be embedded in HTML
uFirst introduced in 1995 as module for Apache
uOpen source, written in C
uSimilar to Perl and C
uPHP is "type-less" language.
uPHP originally stood for "PERSONAL HOME PAGE"
  uPHP runs on different platforms (Windows, Linux,                 Unix, etc.)‏    
  uPHP is compatible with almost all servers used today             (Apache, IIS, etc.)
  uPHP is easy to learn and runs efficiently on the server      side.
  uThe PHP code is enclosed in special start and end            processing instructions <?php and ?>  that allow you      to jump into and out of "PHP mode."