SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: basic syntax

  1. #1
    SitePoint Addict skyhigh007's Avatar
    Join Date
    Jun 2006
    Posts
    363
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    basic syntax

    Hi

    what does single quotation and double quotation mean in belw statement.

    echo '<option value="' . $row['movietype_id'] . '">' . $row['movietype_label'] . '</option>' . "\r\n";

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    double " is for the HTML part of the syntax so that it is parsed properly the single quote and period escape out of the echo....
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Addict skyhigh007's Avatar
    Join Date
    Jun 2006
    Posts
    363
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i thought . is for concatenation.

  4. #4
    SitePoint Wizard Young Twig's Avatar
    Join Date
    Dec 2003
    Location
    Albany, New York
    Posts
    1,355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by skyhigh007
    i thought . is for concatenation.
    It is. And double- and single-quotes are both used for strings. The difference between the two is that single-quotes are more literal (and supposedly faster), where double-quotes are not.

    Ex:
    '\n' = \n
    "\n" = newline


Bookmarks

Posting Permissions

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