PHP

 Home  Computers & Internet  Web Programming PHP
What is PHP?
Echo
Comments
Variables
Constants
Data Types
number_format()
Character Strings
Mathematical Operators
Comparison Operators
Logical Operators
Joining Strings
explode()
implode()
strtolower()
strtoupper()
strlen()
ucfirst()
ucwords()
strrev()
str_replace()
str_repeat()
trim()
strip_tags()
addslashes()
stripslashes()
strpos()
strrpos()
nl2br()
isset()
unset()
empty()
POST
GET
If Statements
If Else Statements
Elseif Statements
Switch Statements
For Loops
While Loops
Do While Loops
Foreach Loops
File Create
File Open
File Read
File Write
File Delete
fgets()
file_get_contents()
Date & Time
$_SERVER
Sessions
Cookies
Arrays

WHAT IS PHP?

PHP is an acronym for Hypertext Preprocessor and is a popular, fully-featured, open-source server-side scripting language. PHP allows developers to develop dynamic web pages. PHP is server-side meaning it resides and processes on the server that a particular website is on.

PHP overcomes the shortcomings of HTML (Hyper Text Markup Language) , which is essentially static and can only display web pages. On the other hand, PHP can interact with html, communicate with databases, provide user-specific member pages, secure logins, etc.

PHP is very popular because:

1. It processes fast.
2. It is free.
3. It is very simple to learn and use.
4. It’s customizable.
5. There is a huge network of help and tutorials.
6. It’s secure.
7. It’s versatile and can work well with html, output html, javascript, etc.

The PHP processor is loaded on the server the web site resides on. Pages with PHP are named with php extension at the end. When a user requests a PHP page from the server, the PHP processor parses (processes) the PHP codes on page and outputs it as html together with the other html components of the page. So the client receives a page with pure html.

As an example of some things PHP can do and HTML can‘t on it‘s own, consider the login (user authentication) system that is so popular on websites today. Say, you access a website and want to login to your member area. The login form is displayed by the html. This is all the HTML can do ie. display the form and form fields and allows user to type in an input. Without PHP, if you click the form submit button, none of the variables (ie username and password is grabbed). It is the PHP that grabs the input (ie username and password) when you click the submit button, checks with the database if it is valid and if so, logs the user in to his member area, pulling out the necessary member details which are specific to this member and displaying the results as html in the members area.

Home | Privacy Policy | Terms Of Use | Contact Us