PHP(HYPER TEXT PREPROCESSOR) PHP is a scripting language originally designed for producing dynamic web pages. It has evolved to include a command line interface capability and can be used in standalone graphical applications.[2] While PHP was originally created by Rasmus Lerdorf in 1995, the main implementation of PHP is now produced by The PHP Group and serves as the de facto standard for PHP as there is no formal specification.[3] PHP is free software released under the PHP License, which is incompatible with the GNU General Public License (GPL) due to restrictions on the use of the term PHP.[4] PHP is a widely-used general-purpose scripting language that is especially suited for web development and can be embedded into HTML. It generally runs on a web server, which is configured to take PHP code as input and create web page content as output. It can be deployed on most web servers and on almost every operating system and platform free of charge.PHP is installed on over 20 million websites and 1 million web servers PHP syntax and semantics Syntax-highlighted PHP code embedded within HTML PHP only parses code within its delimiters. Anything outside its delimiters is sent directly to the output and is not parsed by PHP. The most common delimiters are , which are open and close delimiters respectively. and delimiters are also available. Short tags can be used to start PHP code, . These tags are commonly used, but like ASP-style tags (<% or <%= and %>), they are less portable as they can be disabled in the PHP configuration. For this reason, the use of short tags and ASP-style tags is discouraged.[53] The purpose of these delimiters is to separate PHP code from non-PHP code, including HTML.[54]
The first form of delimiters, , in XHTML and other XML documents, creates correctly formed XML 'processing instructions'.[55] This means that the resulting mixture of PHP and other markup is well-formed XML.
Variables are prefixed with a dollar symbol and a type does not need to be specified in advance. Unlike function and class names, variable names are case sensitive. Both double-quoted ("") and heredoc strings allow the ability to embed a variable's value into the string.[56] PHP treats newlines as whitespace in the manner of a free-form language (except when inside string quotes), and statements are terminated by a semicolon.[57] PHP has three types of comment syntax: /* */ marks block and inline comments; // as well as # are used for one-line comments.[58] The echo statement is one of several facilities PHP provides to output text (e.g. to a web browser).
In terms of keywords and language syntax, PHP is similar to most high level languages that follow the C style syntax. If conditions, for and while loops, and function returns are similar in syntax to languages such as C, C++, Java and Perl.
|