Introduction to PHP
Learning
Objectives
At the end of
this topic, you will be able to:
- Describe what PHP is
- List the uses of PHP
- List the advantages of PHP
- List the important characteristics of PHP
- Describe how to use PHP
- List the components required for PHP
- Setup the components required for PHP
- Create PHP files
- Run PHP files
- PHP is Hypertext Preprocessor.
- PHP is a widely-used open source server-side scripting language
- PHP is used to create dynamic web pages
- PHP is the most popular scripting language on the web
- PHP was previously called Personal Home Page
Uses of PHP
- PHP is used for web development and it can be easily embedded into HTML
- PHP enables you to create pages to implement authentication, check details using forms, create galleries, and create surveys.
- Implement authentication
- Check details using forms
- Create galleries
- Create surveys
- Manage databases
- Manage dynamic content
- Track sessions
- PHP can perform system functions - It can create, open, read, write, or close files on a system
- PHP can handle forms - It can gather data from files, save data to a files, send data through emails, return data to users
- PHP can interact with databases - It can add, delete, or modify data from databases
- PHP can set cookies and access cookie variables
- PHP can implement authorization and security - It can restrict user access to certain pages and also encrypt data
Advantages of PHP
- PHP is a server-side language, PHP code is executed on the server and the results are displayed on the browser
- PHP can be embedded in HTML which is widely used language
- PHP supports a large number of protocols such as POP3, IMAP, and LDAP
- PHP4 supports Java and distributed object architectures (COM and CORBA) which enables development of n-tier applications
- PHP's syntax is similar to C and is easier to learn
- PHP scripts can be tested easily installing a server like wampserver
- PHP can be downloaded and used for free
- PHP can generate page content dynamically
- PHP runs on different platforms such as Windows, Linux, Unix, Mac OS X.
- PHP is compatible with almost all servers
- PHP supports a wide range of databases
- PHP is easy to learn and runs efficiently