
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.
What is a Scripting Language?
A script is a set of programming instructions that is interpreted at runtime.
A scripting language is a language that interprets scripts at runtime. Scripts are usually embedded into other software environments.
The purpose of the scripts is usually to enhance the performance or perform routine tasks for an application.
Server side scripts are interpreted on the server while client side scripts are interpreted by the client application.
PHP is a server side script that is interpreted on the server while JavaScript is an example of a client side script that is interpreted by the client browser. Both PHP and JavaScript can be embedded into HTML pages.
Programming Language Vs Scripting Language
| Programming language | Scripting language |
| Has all the features needed to develop complete applications. | Mostly used for routine tasks |
| The code has to be compiled before it can be executed | The code is usually executed without compiling |
| Does not need to be embedded into other languages | Is usually embedded into other software environments. |
Instead of lots 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 <?php and ?> that allow you to jump into and out of “PHP mode.”
What distinguishes PHP from something like 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 web 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 things in using PHP are that it is extremely simple for a newcomer, but offers many advanced features for a professional programmer. 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 a few hours.