Introduction to PHP


INTRODUCTION OF PHP

  • ·       PHP (Personal Home Pages) developed by Rasmus Lerdorf in 1995. 
  •      Also stands for Hypertext Pre-processor ( Hypertext:- text containing web mark-ups, Pre-processor:- all the Hypertext is processed first and then the result is sent as HTML to the web browser)
  •       A client cannot see the PHP source code.
  • ·    A server-side scripting language (interpreted on the server).
  • ·    Used to develop Static websites or Dynamic websites or Web applications.
  • ·   A scripting language interprets scripts at runtime.
  • ·   Script:- a set of programming instructions, embedded into other software environments and used to enhance the performance or perform routine tasks for an application.
  • ·  Server-side scripts:- interpreted on the server ex. Php
  • ·  Client-side scripts:- interpreted by the client application ex. Java script. 
  •      Client computers accessing the PHP scripts by a web browser.
  • ·   PHP code embedded into HTML code or used in combination with various web template systems, web content management systems, and web frameworks.
  • A PHP file contains PHP tags and ends with the extension ".php".


Syntax:- 
<?Php
PHP code goes here
?>

Html embedded php code
 
<html>
 
<head>
<title>PHP Example</title>
</head>
 
<body>
 
<?Php
PHP code ;
?>
</body>
 
</html>
 
 Example:
<html>
 
<head>
<title>PHP Example</title>
</head>
 
<body>
<?Php echo "Hello, World! This is PHP code";?>
</body>
 
</html>
 
 
Output:
Hello, World! This is PHP code
 
 =================================

PHP Features

Performance:

  • The PHP script is executed much faster than other languages such as JSP and ASP.
  • Uses own memory, so the server workload and loading time is automatically reduced, and processing speed faster and better performance. 
  • An Interpreted language, need not a compiler.


Open Source:

  • Source code and software are freely available on the php.net official website
  • Easy to install and set up.


Familiarity with the syntax:

  • Many syntaxes, features, and specific functions are similar to C, Java, and Perl.
  • Easily understandable syntax.
  • Comfortable coding.


Embedded: 

  • Easily embedded within HTML tags and script. 
  • Use  forms, for collect the data from users, save it into the database and return output useful information to the user. For example - Registration form.


Platform Independent:

  • Available for WINDOWS, MAC, LINUX & UNIX operating system.
  • Application developed in one OS can be easily executed in other OS also.


Database Support:

  • Supports all the leading databases such as MySQL, SQLite, ODBC, etc.


Error Reporting:-

  • Use predefined error reporting constants to generate an error notice or warning at runtime. E.g., E_ERROR, E_WARNING, E_STRICT, E_PARSE.


Loosely Typed Language:

  •  Use variable without declaring its datatype.
  • Automatically convert or use data type according to store value at runtime.


Web servers Support:

  • Compatible with almost all local servers used today like Apache, Netscape, Microsoft IIS, etc.


Security:

  • Provides multiple layers of security to prevent threats and malicious attacks. 
  • Encrypt the data and apply validation.


Control:

  • Maximum control over the websites due to few lines of code and can changes easily whenever we want. 
  • Supports various protocols such as Hypertext Transfer Protocol (HTTP), POP3 (Post Office Protocol 3), Simple Network Management Protocol (SNMP), LDAP (Lightweight Directory Access Protocol),  Internet Message Access Protocol (IMAP), and many more. 
  • It handles dynamic content, database as well as session tracking (maintain state (data) of an user.) And cookies (a small piece of text sent to your browser by a website when we visit. It helps the site remember information about our visit, )for the website.


Help by PHP Community:

  • A large community of developers regularly updates documentation, tutorials, online help, and faqs. 
  • Provides Many good PHP frameworks like Zend, Codeigniter, and Laravel. 
  • Develop Popular Content Management Systems like Joomla, Drupal, etc . 

Uses of PHP

  • Create Web applications like Social Networks (Facebook, Digg), Blogs(WordPress, Joomla), e-commerce websites(OpenCart, Magento etc.) Etc.
  • Common Line Scripting to perform different operations on any machine.
  • Sending Emails or building email applications.
  • WordPress is one of the most used blogging(content management system  -CMS) platforms in the World and provides WordPress plugin for application development.



================================================


Post a Comment

0 Comments