Quote:
Originally Posted by dsrdakota
PHP source code must be in PHP Tags:
|
When PHP parses a file, it looks for opening and closing tags, which are
<?php and
?>
PHP also allows for short tags
<? and
?> (
which are discouraged because they are only available if enabled with short_open_tag php.ini configuration file directive, or if PHP was configured with the --enable-short-tags option
==============================
Quote:
Originally Posted by dsrdakota
and HTML source can't be inside unless in `echo` functions ex:
echo "<br />";
|
while you did not ask how to put HTML code inside PHP code
here is one way to put a whole HTML page inside PHP code
PHP Code:
<?php
print <<<here
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>
Test Hello World
</title>
</head>
<body>
<h1>Hello World</h1>'
</body>
</html>
here;
?>
==============================
Quote:
Originally Posted by dsrdakota
HTML can go above or below PHP Tags.
|
You can mix HTML and PHP code as much as you like in your source file