My samples come from an O'Reilly book and various websites.
Am I doing something wrong?
I'm a mac newbie doing this in Netbeans on the mac with MAMP 1.8.2 installed. Mamp has PHP 5 with Zend Extensions (don't know what that is). I copied the text for index.php to another editor, thinking it might be something with netbeans, but that didn't help.
this code, below, outputs only one line.
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
$variables = "a test variable";
$string = <<< END_OF_STRING
this is a multi-line
string containing variables
and single quotes '
and double quotes "
and slashes \
do not need to be escaped
END_OF_STRING;
echo $string
?>
</body>
</html>
this is a multi-line string containing a test variable and single quotes ' and double quotes " and slashes \ do not need to be escaped