SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    May 2013
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What is this slash in class=\"

    Hi guys,

    I can't find the proper explanation for this script:

    $output = "<ol class=\"category\">";

    what does this slash do?

    Thanks.

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by kanoy83 View Post
    I can't find the proper explanation for this script:

    $output = "<ol class=\"category\">";

    what does this slash do?
    It's an 'escape character'. Because a " has special meaning in most programming languages (ie start/end of text string), when you want to include a " in that text string, you need some way to tell the computer ‘No, this really is a ", it isn't the end of the string’, and you do that by putting a \ before it.

  3. #3
    SitePoint Member
    Join Date
    May 2013
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this should be added in other definitions. Awesome. Thanks!


Tags for this Thread

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
  •