How to trim free space at the end of url

Discussion in 'PHP' started by uploader, Jul 31, 2009.

  1. #1
    Hi, i need help regarding removing the free space at the end of url.

    let the url be "http://rapidshare.com/files/25662065/Test.rar "
    note the space at the end of rar
    i need to convert it to "http://rapidshare.com/files/25662065/AdsenseGold.rar"
    i have to trim the free space whether it be single space or multiple space
    i heard we can use rtrim
    but how to use it
    thanks a lot
     
    uploader, Jul 31, 2009 IP
  2. ezprint2008

    ezprint2008 Well-Known Member

    Messages:
    611
    Likes Received:
    15
    Best Answers:
    2
    Trophy Points:
    140
    Digital Goods:
    1
    #2
    // If the user is putting in a URL - convert it to a variable.
    $url = $_POST['url'];

    // then trim it
    trim($url);
     
    ezprint2008, Jul 31, 2009 IP
  3. CI-Andrew

    CI-Andrew Peon

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #3
    yep, what ezprint said, very simple with trim() function
     
    CI-Andrew, Jul 31, 2009 IP