Results 1 to 3 of 3

Thread: Stripping characters

  1. #1
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Stripping characters

    I have a PhP variable called $edited which value is, for example; /62fg5/
    I wish to strip all the "/" from it, so I would be left with 62fg5
    I have tried this;
    PHP Code:
    $edited str_replace($edited,"/","");
    echo 
    $edited
    But with that echo, nothing is outputted. It's like it makes the WHOLE variable equal to nothing, rather than just the slash. Can anyone help?

  2. #2
    Join Date
    Jul 2008
    Posts
    199
    Thanks
    6
    Thanked 58 Times in 57 Posts

    Default

    Your parameters are in the wrong places. It should be:
    PHP Code:
    $edited str_replace("/",""$edited);
    echo 
    $edited

  3. The Following User Says Thank You to techietim For This Useful Post:

    Moglizorz (09-28-2008)

  4. #3
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    My bad. Thanks lol :P +thanks.

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
  •