Jump to content
Larry Ullman's Book Forums

Ch5 Use Concatenation With Function Pg 105

Recommended Posts

Hi there


According to the book, the two print statements below are the same.


1. (On page 104) print "<p>Click <a href=\"thanks.php?name=$name&email=$email\">here</a>to continue.</p>" ;


2. (On page 105) print 'Click <a href="thanks.php?name=' . $name . '&email=' . $email . ' ">here</a>to continue.' ;


What we don't understand is that why use concatenation, why not the print statement (on page 105) looks like below (without concatenation)


print 'Click <a href="thanks.php?name=$name&email=$email">here</a>to continue.' ;

Note: the print above contains double quotes for the url and because the single quotes of the print are used, no escape of double quote is required.


We believe we miss something but not sure what it is.


Thanks in advance for any explanation.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...