What is PHP?
What is PHP, and what can you do with it? This gentle PHP introduction explains the basics of PHP and looks at how you can use it to build feature-rich Web pages and applications.
PHP is a programming language that you can use to write Web applications. A Web application can be anything from a simple "contact us" form through to a fully-fledged blogging system, online store, or forum system.
PHP is a server-side language
PHP is open source
The PHP engine — that is, the code that sits on the Web server and runs PHP scripts — is open source, which means anyone can access and work on the engine's source code. This helps to ensure that PHP will be around for a long time to come.
PHP is free to download and use, which is one reason why it is so popular among Web hosting companies. You'll find that the vast majority of Web hosting accounts support PHP.
PHP is geared towards the Web
While many programming languages can be used to build Web applications, PHP is one of the few languages specifically designed for the Web. To this end, it includes a lot of useful Web-related features out of the box, such as:
- Easy ways to read and handle Web forms and cookies
- Functions for creating and manipulating graphics
- The ability to talk to popular databases such as MySQL, and
- Functions for working with HTML.
You can mix PHP code with HTML code
One nice feature of PHP is that you can insert chunks of PHP code into an HTML page. You surround the PHP chunks with special symbols. When the Web server retrieves the page, any PHP chunks are run by the PHP engine, while the other parts of the page are sent as they are to the browser.
This feature makes it easy to add interactivity to otherwise plain Web pages — great for contact forms and the like.
Uses of PHP
You can use PHP to write practically any type of Web application or script. Common PHP applications include:
- Blogging software such as WordPress
- E-commerce systems like Magento
- Content management systems including Drupal and Joomla!, and
- Forum software such as phpBB.
In addition, many popular websites, including Yahoo!, Wikipedia, Facebook, and Digg, use PHP code extensively.
Alternatives to PHP
If you don't fancy using PHP then there are many similar languages available. Some common server-side languages include:
- Perl (read our Perl articles)
- ASP and its successor, ASP.NET (read our ASP articles)
- Ruby, and
Learn more about PHP
To get started with writing PHP scripts, try the Writing your first PHP script tutorial.
Learn PHP With Ease!
Written by Matt Doyle — ELATED's resident Web programming expert — Beginning PHP 5.3 is a complete introduction to PHP, covering everything in these tutorials and lots more besides. Find out how to:
...and lots more!
“What a pleasure it's been spending hours and hours studying PHP with this magical book.” — Lulio, Florida
“The book is not only great for learning, but I find myself using it constantly as a reference as well!” — David A. Stoltz
Responses to this article
There are no responses yet.
Post a response
Want to add a comment, or ask a question about this article? Post a response.
To post responses you need to be a member. Not a member yet? Signing up is free, easy and only takes a minute. Sign up now.