Hi all,

I have never used heredoc before. Thought I would give it a go with the following code:

function site_header ( $title ) {
	print <<< XHTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>$title</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>    
XHTML; } // site_header ( $title )

I am getting the following error message:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in ...

Any ideas of the problem? Is it to do with the php.ini?

Cheers

SOL

    Though I've never used heredoc, I'm thinking you still need to terminate your quotes with slashes

      Thanks for the suggestion. I have now tried it with no change. I was using heredoc because you are not meant to need escape slashes. Any other ideas?

      SOL

        i believe the problem was to do with the indenting........ there must be no whitepace before the XHTML;.

          Write a Reply...