HTML and CSS Reference
In-Depth Information
A popular programming language often used in .NET is C# (pronounced See Sharp ), which has been standardized by
ECMA [46] and ISO [47, 48]. C# is a multiparadigm programming language, which is declarative, generic, functional,
and imperative, and it has strong typing. C# applies object-oriented (class-based) as well as component-oriented
Perl is a high-level, interpreted, general-purpose, dynamic programming language. The specification of the language
is available at [49]. In the late 1990s, Perl became popular as a CGI scripting language because of its parsing
abilities. The core syntax of Perl is summarized in the “Perl style guide” [50]. A very impressive text-processing feature
of Perl is that it can handle text files of arbitrary length if enough memory is available.
PHP: Hypertext Preprocessor is one of the most popular open source server-side scripting languages. It is a cross-
platform, general-purpose language originally designed for generating dynamic web pages. Some programmers have
tried to introduce “standardized” best practices for PHP over the years [e.g., 51, 52, 53, 54], none of which gained an
official status yet. The major specification of PHP is being maintained by the PHP Group [55], which is considered as
the de facto standard of the language, because there is no formal specification.
PHP is the widely used, free, and efficient alternative to competitors such as ASP.NET.
Embedding and Loading PHP
While some PHP code is embedded in (X)HTML documents and mixed with markup elements, complex PHP
applications are provided in external files.
PHP in the Markup
PHP code is usually delimited by <?php and ?> or <script language="php"> and </script> . The less portable
short tags <? and <?= and ASP-style tags such as <% and <%= should not be used. PHP parsers parse code only within
the delimiters. In XML documents (including XHTML), the first embedding method provides well-formed XML
processing instructions. Since they are not part of the character data in the document, there is the potential that the
combination of markup and PHP code provides valid markup on the server before PHP parsing.
The simplest example for embedding PHP in the markup is a “Hello World” script such as hello.php
(Listing 6-49).
Listing 6-49. “Hello World” in PHP
<!DOCTYPE html>
<html xmlns=" " xml:lang="en" lang="en">
<title>Hello World in PHP</title>
<meta charset="UTF-8" />
<?php echo '<p>Hello World</p>'; ?>
Search WWH ::

Custom Search