Jump to content
Larry Ullman's Book Forums

Quotes Example Chapter 2


Recommended Posts

Yup, already ran into trouble.

 

Page Chapter 2, Page 46,47

 

Here's my script:

 

 

<?php // Script 2.4 - quotes.php

 

//single or double quotation marks won't matter here:

$first_name = 'Saige';

$last_name = "The Powerful";

 

//single or double quotation marks DOES matter here:

$name1 '$first_name $last_name'; <----- Line 16

$name2 "$first_name $last_name";

 

//single or double quotation marks DOES matter here:

 

print "<h1>Double Quotes</h1> <p>name1 is $name1 <br />

name2 is $name2</p>";

 

print '<h1>Single Quotes</h1> <p>name1 is $name1 <br />

name2 is $name2 </p>'

?>

 

 

Here's my error message:

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /quotes.php on line 16

Link to comment
Share on other sites

 Share

×
×
  • Create New...