nootkan Posted August 2, 2014 Share Posted August 2, 2014 After studying the section on quotation marks I wrote this script: <?php // scalar.php $first_name = "Paul"; $last_name = "Smith"; $age = 57; $birth_date = "july 15,1957"; print "<p>First Name:$first_name<br />Last Name:$last_name<br />Age is:$age<br />Date of Birth:$birth_date</p>"; ?> then I wrote this one: <?php // scalar.php $first_name = 'Paul'; $last_name = 'Smith'; $age = 57; $birth_date = "july 15,1957"; print "<p>First Name:$first_name<br />Last Name:$last_name<br />Age is:$age<br />Date of Birth:$birth_date</p>"; ?> However I see no difference when using single or double quotes. Based on my interpretation of single and double quotes not being printed the same in the book, what am I not understanding? Link to comment Share on other sites More sharing options...
Larry Posted August 3, 2014 Share Posted August 3, 2014 Try it again using single quotes for the print statement. Link to comment Share on other sites More sharing options...
nootkan Posted August 3, 2014 Author Share Posted August 3, 2014 Okay I get it now only affects the print statement not the variables. Link to comment Share on other sites More sharing options...
Larry Posted August 4, 2014 Share Posted August 4, 2014 Well, to be clear, the quotes you use affects the use of variables within the quotes. This is true for both print statements and assignment--really, anything quoted. Link to comment Share on other sites More sharing options...
Recommended Posts