1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to properly encode this string?

Discussion in 'PHP' started by fcmisc, Feb 22, 2008.

  1. #1
    fcmisc, Feb 22, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Use & instead of &.

    And it's not really a PHP question...
     
    nico_swd, Feb 22, 2008 IP
    fcmisc likes this.
  3. Cybernaut

    Cybernaut Peon

    Messages:
    408
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Don't urlencode full url at once. Only query variable names and values need urlencode'ing. Path in url need to be rawurlencode'd. But this urlencoding is only needed when url path or querry vars contain characters that are not allowed there. To create valid html, just encode url using htmlspecialchars function.
     
    Cybernaut, Feb 22, 2008 IP
    fcmisc likes this.