linuxStat PHP Documentation

A PHP program can be embedded in HTML documents.
It is preceded by the tag <?php and followed by the tag ?>.
The following is an HTML document containing a PHP program
that will print out the text: "I love Linux.".

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<title>Executed on Dell Server, Intel Processor, created on HP laptop</title>
</head>
<body bgcolor="#0F243E" text="#FFFF00" lang=EN-US>
<font size="5">
<?php
print "I love Linux.";
?>
</font>
</body>
</html>

The above example PHP program has a single print statement in it.
The print statement prints out a line of text. Text is also known as string.
Instead of using the term text, I will use the term string.
The print statement is followed by a ;. Every PHP statement
must be followed by a ;.

I have saved the above HTML document in a file called example1.php
in the directory PHP. If you click the following link
then the above HTML document will be returned to your
browser with the result of executing the PHP program by the server's
PHP interpreter. Use View->Source to verify this after you click the link.
Also, look at the address line of your browser.

Try the above example     Next     Index