What is PHP

PHP: Hypertext Preprocessor

PHP originally stood for Personal Home Page

Updated: May 10, 2019
By: RSH Web Editorial Staff
Horde vs Roundcube

A widely used open source general purpose scripting language that is especially suited for web development. PHP code may be embedded into HTML code or pages, it can be used in combination with various web template systems, web content management systems, web frameworks, or even executed with a Command Line Interface (CLI)

What distinguishes PHP from client side JavaScript is that the code is executed on the server, generating HTML which is then sent to the client. The client would receive the results of running that script, but would not know what the underlying code was. You can even configure your Server to process all your HTML files with PHP, and then there's really no way that users can tell what you have up your sleeve

The best thing with PHP is that it's extremely simple for a newcomers, but also offers many advanced features for those professional programmers. Don't be afraid reading the long list of PHP's features. You can jump in, in a short time, and start writing simple scripts in no time

Although PHP's development is focused on server-side scripting, you can do much more with it

An introductory example of a PHP page

<!DOCTYPE html>
<html lang=en>
echo "Hi, I'm a PHP script!";

Instead of a lot of commands to output HTML (as seen in C or Perl), PHP pages contain HTML with embedded code that does "something" (in this case, output "Hi, I'm a PHP script!"). The PHP code is enclosed in special start and end processing instructions that allow you to jump into and out of "PHP mode"
<?php and ?>

PHP is mainly focused on server-side scripting, Anything any other CGI program can do, such as collect form data, generate dynamic page content, or send and receive cookies PHP can do

There are three main areas where PHP scripts are used

Server Side Scripting

This is the main target field for PHP. You need three things to make PHP work: the "PHP parser" (CGI or server module), a "Web Server" and of course a "Web Browser". You need to run the Server with a connected installation of PHP. You can access the program output with any web browser. This can also run on your home machine if you are trying out PHP

Command Line Scripting

You can make a PHP script run without any server or browser. You only need the PHP parser to use in this way. This type of use is ideal for PHP scripts regularly executed using cron (on *nix or Linux) or Task Scheduler (on Windows). This can also be used for simple text processing tasks

Writing Desktop Apps

PHP is really not the best language to create a desktop application with a graphical user interface, but if you know PHP good and use some advanced PHP features in your client side applications. You also can write cross platform applications. PHP-GTK is an extension to PHP, not available in the main distribution. If you are interested in PHP-GTK, visit Their Website

PHP can be used on all major operating systems, including Linux, many Unix variants (including HP-UX, Solaris and OpenBSD, Microsoft Windows, macOS, RISC OS, and no doubt others. PHP also has support for most of the web servers today

This includes Apache, IIS, and many others. And this includes any web server that can utilize the FastCGI PHP binary, like lighttpd and nginx

PHP works as either a module, or as a CGI processor and you have the freedom of choosing any operating system and a web server. You also have the choice of using procedural programming or object oriented programming (OOP), or a mixture of both

With PHP you are not limited to just HTML output. PHP's abilities includes images, PDF files and flash movies

Using libswf and Ming, generated on the fly. You could also output easily any text, such as XHTML and any other XML file
PHP can auto-generate these files, and save them in the file system, instead of printing it out, forming a server-side cache for your dynamic content

One of the best and most significant features in PHP is the support for a wide range of databases. Writing a database-enabled web pages is incredibly simple using one of the database specific extensions to any database supporting the Open Database Connection standard via the ODBC extension. Other databases may utilize cURL or sockets like CouchDB

PHP also has support for talking to other services using protocols such as LDAP, IMAP, SNMP, NNTP, POP3, HTTP, COM (on Windows) and countless others. You can also open raw network sockets and interact using any other protocol. PHP has support for the WDDX complex data exchange between virtually all Web programming languages. Talking about interconnection, PHP has support for instantiation of Java objects and using them transparently as PHP objects

Tweet  Share  Pin  Tumble  Email

Post your Comments or Questions


1997 - 2019  |  RSH Web Services  |  All Rights Reserved.