What is PHP? What can PHP do? Hypertext Preprocessor 2014
What is PHP? What can PHP do? Hypertext Preprocessor 2014
What Is PHP?
PHP (recursive signifier for PHP: machine-readable text Preprocessor) may be a widely-used open supply all-purpose scripting language that's particularly fitted to internet development and may be embedded into hypertext markup language.
Nice, however what will that mean? associate degree example:
Example #1 associate degree introductory example
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Example</title>
</head>
<body>
<?php
echo "Hi, I'm a PHP script!";
?>
</body>
</html>
Instead of countless commands to output hypertext markup language (as seen in C or Perl), PHP pages contain hypertext markup language with embedded code that will "something" (in this case, output "Hi, i am a PHP script!"). The PHP code is clathrate in special begin and finish process directions that permit you to leap into and out of "PHP mode."
What distinguishes PHP from one thing like client-side JavaScript is that the code is dead on the server, generating hypertext markup language that is then sent to the shopper. The shopper would receive the results of running that script, however wouldn't grasp what the underlying code was. you'll even assemble your internet server to method all of your hypertext markup language files with PHP, and so there is very no method that users will tell what you have got up your sleeve.
The best things in victimization PHP ar that it's very simple for a newcomer, however offers several advanced options for an expert software engineer. do not be afraid reading the long list of PHP's options. you'll jump in, during a short time, and begin writing straightforward scripts during a few hours.
Although PHP's development is concentrated on server-side scripting, you'll do way more with it. Read on, and see a lot of within the What will PHP do? section, or go right to the introductory tutorial if you're solely inquisitive about internet programming.
What will PHP do?
Anything. PHP is principally centered on server-side scripting, thus {you will|you'll|you'll be able to} do something the other CGI program can do, like collect kind knowledge, generate dynamic page content, or send and receive cookies. however PHP will do way more.
There ar 3 main aras wherever PHP scripts are used.
Server-side scripting. this can be the foremost ancient and main target field for PHP. you wish 3 things to create this work. The PHP computer programme (CGI or server module), an internet server and an internet browser. you wish to run the net server, with a connected PHP installation. you'll access the PHP program output with an internet browser, viewing the PHP page through the server. of these will run on your home machine if you're simply experimenting with PHP programming. See the installation directions section for a lot of info.
instruction scripting. you'll build a PHP script to run it with none server or browser. you simply want the PHP computer programme to use it this manner. this sort of usage is good for scripts frequently dead victimization cron (on *nix or Linux) or Task hardware (on Windows). These scripts may also be used for easy text process tasks. See the section regarding instruction usage of PHP for a lot of info.
Writing desktop applications. PHP is maybe not the best language to make a desktop application with a graphical interface, however if you recognize PHP all right, and would love to use some advanced PHP options in your client-side applications you'll additionally use PHP-GTK to jot down such programs. you furthermore may have the flexibility to jot down cross-platform applications this manner. PHP-GTK is associate degree extension to PHP, not offered within the main distribution. If you're inquisitive about PHP-GTK, visit » its own web site.
PHP are often used on all major in operation systems, as well as Linux, several UNIX operating system variants (including HP-UX, Solaris and OpenBSD), Microsoft Windows, Mac OS X, RISC OS, and doubtless others. PHP has additionally support for many of the net servers nowadays. This includes Apache, IIS, and plenty of others. And this includes any internet server that may utilize the FastCGI PHP binary, like lighttpd and nginx. PHP works as either a module, or as a CGI processor.
So with PHP, you have got the liberty of selecting associate degree OS and an internet server. what is more, you furthermore may have the selection of victimization procedural programming or object orientating programming (OOP), or a mix of them each.
With PHP you're not restricted to output hypertext markup language. PHP's skills includes outputting pictures, PDF files and even Flash movies (using libswf and Ming) generated on the fly. you'll additionally output simply any text, like XHTML and the other XML file. PHP will autogenerate these files, and save them within the filing system, rather than printing it out, forming a server-side cache for your dynamic content.
One of the strongest and most vital options in PHP is its support for a good vary of databases. Writing a information-enabled online page is implausibly straightforward victimization one in all the database specific extensions (e.g., for mysql), or victimization associate degree abstraction layer like PDO, or hook up with any information supporting the Open information association customary via the ODBC extension. alternative databases might utilize cURL or sockets, like CouchDB.
PHP additionally has support for speech alternative services victimization protocols like LDAP, IMAP, SNMP, NNTP, POP3, HTTP, COM (on Windows) and multitudinous others. you'll additionally open raw network sockets and act victimization the other protocol. PHP has support for the WDDX complicated knowledge exchange between just about all internet programming languages. Talking regarding interconnection, PHP has support for internal representation of Java objects and victimization them transparently as PHP objects.
PHP has helpful text process options, which has the Perl compatible regular expressions (PCRE), and plenty of extensions and tools to analyse and access XML documents. PHP standardizes all of the XML extensions on the solid base of libxml2, and extends the feature set adding SimpleXML, XMLReader and XMLWriter support.
And many alternative fascinating extensions exist, that ar categorised each alphabetically and by class. And there ar extra PECL extensions which will or might not be documented inside the PHP manual itself, like » XDebug.
As you'll see this page isn't enough to list all the options and edges PHP offers. browse on within the sections regarding putting in PHP, and see the perform reference half for rationalization of the extensions mentioned here.
Category:
0 comments