Source of: /manual/en/intro-whatis.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/introduction.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'intro-whatis.php',
1 => 'What is PHP?',
),
'up' =>
array (
0 => 'introduction.php',
1 => 'Introduction',
),
'prev' =>
array (
0 => 'introduction.php',
1 => 'Introduction',
),
'next' =>
array (
0 => 'intro-whatcando.php',
1 => 'What can PHP do?',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="intro-whatis" class="section">
<div class="info"><h1 class="title">What is PHP?</h1></div>
<p class="para">
<acronym title="PHP: Hypertext Preprocessor">PHP</acronym> (recursive acronym for <i>PHP: Hypertext
Preprocessor</i>) is a widely-used open source general-purpose
scripting language that is especially suited for web
development and can be embedded into HTML.
</p>
<p class="para">
Nice, but what does that mean? An example:
</p>
<p class="para">
</p><div class="example">
<div class="info"><p><b>Example #1 An introductory example</b></p></div>
<div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"<br /> "http://www.w3.org/TR/html4/loose.dtd"><br /><html><br /> <head><br /> <title>Example</title><br /> </head><br /> <body><br /><br /> <span style="color: #0000BB"><?php<br /> </span><span style="color: #007700">echo </span><span style="color: #DD0000">"Hi, I'm a PHP script!"</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">?><br /></span><br /> </body><br /></html></span>
</code></div>
</div>
</div><p>
</p>
<p class="para">
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 <a href="language.basic-syntax.phpmode.php" class="link">start and end processing
instructions <code class="code"><?php</code> and <code class="code">?></code></a>
that allow you to jump into and out of "PHP mode."
</p>
<p class="para">
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.
</p>
<p class="para">
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.
</p>
<p class="para">
Although PHP's development is focused on server-side scripting,
you can do much more with it. Read on, and see more in the
<a href="intro-whatcando.php" class="link">What can PHP do?</a> section,
or go right to the <a href="tutorial.php" class="link">introductory
tutorial</a> if you are only interested in web programming.
</p>
</div><?php manual_footer(); ?>