www.webdeveloper.com
Results 1 to 14 of 14

Thread: Is the semicolon in the correct place?

Threaded View

  1. #1
    Join Date
    Jun 2007
    Location
    USA
    Posts
    30

    Question 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.

    Q:semicolon.jpg
    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:
    Code:
    $name = $_GET['name'];
    
    print "<p>Hello, <span style=\"font-weight:bold;\">$name</span>!</p>";
    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.
    Last edited by waveform; 05-11-2013 at 11:08 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles