Jump to content
Larry Ullman's Book Forums

Recommended Posts

<!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" xml:lang="en" lang="en">


<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>




<?php # Script 1.6 - strings.php


// Create the variables:

$first_name = 'Haruki';

$last_name = 'Murakami';

$book = 'Kafka on the Shore';


// Print the values:

echo "<p>The book <em>$book</em> was written by $first_name $last_name.</p>";






When i run this script in my browser it is producing this result:


The book $book was written by $first_name $last_name."


; ?>



I don't understand why the "; ?>" is being displayed when the double quotes already closed the echo statement?

Link to comment
Share on other sites

Ha, i know what the problem was when i use the MacBook the Mamp server was starting up automatically when i turned it on. But i switched over to Windows 7 and forgot to start up the server, now its working. Sorry about that. :)

Link to comment
Share on other sites


  • Create New...