What is PHP and what is it used for?
PHP stands for Hypertext Pre-processor. On this occasion, the acronym doesn’t match the name.
PHP is an open source, server-side, scripting language used for the implementation and development of web applications.
Scripting language means it is a script-based program (using lines of code) written for the automation of tasks.
Over 80% of server-side languages on the internet are PHP. Many of these are made up of PHP based content management systems (CMS) such as WordPress but even if you remove these systems PHP still makes up over half of all the server-side languages used on the internet.
Apart from the many server-side tasks it performs, it is most commonly embedded into html to make websites more functional. HTML is used to tell a browser how to display the elements on a webpage but it is not a programming language and other than setting out the basic webpage content and layout it is quite limited in what it can do. PHP is a scripting language, and can be used to create much more functional web pages which have a HTML base layout.
PHP is mainly focused on server-side scripting and it excels at collect form data, generating dynamic page content or sending and receiving cookies, but it can also do much more.
There are three main areas where PHP scripts are used.
1. Server-side scripting
This is where it excels. You need these three things to use it:
The PHP parser.
A web server.
A web browser.
You simply run the web server with the connected PHP installation, access the PHP program output using a web browser and view the PHP page via the server.
You can set this up on your home computer if you just wanted to learn it and experiment with some PHP commands.
2. Command line scripting
You can run a PHP script without a server or browser. You just need the PHP parser to run it. This type of usage is most commonly used for scripts regularly executed on a server such as cron jobs etc. or for running simple text processing tasks.
3. Writing desktop applications
You can write a program iusing PHP but there are many better languages for creating desktop based programmes. PHP is still used for some programs and it has some advanced features mainly used in client-side applications. PHP-GTK is often used in order to write these programs where you also have the ability to create cross-platform programs in this manner.
What is PHP GTK?
PHP-GTK is an extension to PHP. It is not part of the main distribution. If you are interested in PHP-GTK, here is the site: http://gtk.php.net/
Where is PHP used?
PHP can be used on all major operating systems including Linux, most Unix variants (including HP-UX, Solaris and OpenBSD), Microsoft Windows, macOS, RISC OS, and many others.
It also has support for most of the web servers today. This includes Apache, IIS, and many others and includes any web server that can utilize the FastCGI PHP binary such as nginx. PHP can function either as a module or as a CGI processor.
What can PHP do?
PHP can generate any output, dynamically if required, which can include text, HTML and any variant (XHTML etc.), images, PDF files, Flash movies (via libswf and Ming) and many other forms of data. It can automatically generate these files and save them in the file system, instead of printing them out, which can then form a server-side cache for dynamic content.
PHP also has good support for connecting with other services using protocols such as LDAP, IMAP, SNMP, POP3, HTTP, COM (on Windows) and many others. You can even open raw network sockets and interact using any protocol.
PHP is often used for its text processing features which include Perl compatible regular expressions (PCRE) and many other extensions and tools to parse and access XML documents.
What language is PHP written in?
In its current form, PHP is actually the successor to PHP/FI which was created in 1994 by Rasmus Lerdorf. The very first version of PHP was just a simple set of Common Gateway Interface (CGI) binaries written in the ‘C’ programming language.
Is PHP difficult to learn?
No, the language itself is quite easy to learn but also quite difficult to master and because there are so many elements and usages it often takes many years before you can class yourself as an expert! There are many aspects to learn in order to get the most out of the language, especially where matters such as security and maintenance are concerned but it is quite an easy readable language.
If you need any PHP scripts installing to your server or need some PHP type input to your website contact us here: firstname.lastname@example.org