Is the semicolon in the correct place?
Hello. I'm still new to some basic formatting concepts. Something confused me in the book I was reading.
when you have CSS style rules embedded in an PHP string, is the semicolon (that ends the statement after the font formatting) always placed before the double quote? Example in the second line of code:
I got confused because I know usually the semicolon surrounds the entire string, including any variable, and other tags that may include things such as the paragraph ..ect. The semicolon is always placed after the double quotes. However, in this case it seems that because there are style rules in the sting, the author of the book is placing the semicolon before the double quotes. Is this correct or a typo? The last semicolon surrounding the entire string "is" actually placed after the double quotes which I know to be correct, but this is not the case for the semicolon towards the center of the string.
$name = $_GET['name'];
print "<p>Hello, <span style=\"font-weight:bold;\">$name</span>!</p>";
Last edited by waveform; 05-11-2013 at 11:08 AM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread