SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    May 2004
    Location
    Chicago
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PrintF_Display character

    Can someone explain the backslash prior to the quotation mark and the question mark after the s

    printf("<a href=\"%s?id=%s\">%s %s</a><br>\n", $PHP_SELF, $myrow["id"], $myrow["Store"], $myrow["Amount"]);

  2. #2
    SitePoint Evangelist
    Join Date
    Feb 2004
    Location
    Sofia, Bulgaria
    Posts
    421
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the backslash prior to the quotation mark is to escape double quotes, because the whole formatting string is encapsulated in double quotes.. and the question mark after the s is just a sign that separates scriptname from GET parameters in query string.. so the output will be:
    Code:
    <a href="yourscript.php?id=1">Store Amount</a><br>
    the parameters you pass to printf() function are in italic and the marks are in red.. i hope you understand it now..


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
  •