SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to change + to space???

    I'm getting data through urlencode, and in my url the data looks like this:

    mysite.pgp?usename=peter%20williamson

    When I retrieve the code in my script like this:
    PHP Code:
    echo ''.urlencode($_GET['username']).''
    I get the name like this:

    peter+williamson

    How do I change the "+" to " ". (space)

    Hope somebody has some good ideas...

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,508
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    http://www.php.net/manual/en/function.str-replace.php

    Ehmm, and if you don't use the urlencode?
    PHP Code:
    echo $_GET['username']; 

  3. #3
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    perhaps you meant urldecode() instead of urlencode()?
    Last edited by Stormrider; Jun 19, 2008 at 04:46.

  4. #4
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks... urldecode() did the job :-)


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
  •