Hi, I've just begun today to learn PHP; I'm using the XHTML 1.1 doctype and it works like a charm:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<meta http-equiv="expires" content="-1" />
<meta name="author" content="Ferio"/>
<meta name="Description" content="PHP exercises" />
<meta name="Keywords" content="Exercises, PHP" />
<meta name="Robots" content="all" />
<title>Mi 1st PHP program</title>
</head>
<body>
<?php
echo "Hello World!";
?>
</body>
</html>
The problem is that I wanted to add the XML declaration on top of the code to make it completely XHTML 1.1 compliant:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<meta http-equiv="expires" content="-1" />
<meta name="author" content="Ferio"/>
<meta name="Description" content="PHP exercises" />
<meta name="Keywords" content="Exercises, PHP" />
<meta name="Robots" content="all" />
<title>Mi 1st PHP program</title>
</head>
<body>
<?php
echo "Hello World!";
?>
</body>
</html>
But when I do this, Firefox returns:
Code:
Parse error: syntax error, unexpected T_STRING in /var/www/firstprog.php on line 1
How could I add this line without getting this error?
Bookmarks