Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Feb 2003
    Posts
    101
    Thanks
    0
    Thanked 0 Times in 0 Posts

    cant figure out how to delete "\." from a string.

    Hi!
    after using
    Code:
    quotemeta("[user@domain.com]");
    I get
    Code:
    \[user@domain\.com\]
    and now I can not figure out how to rid off \. from that string....
    here is what I was trying to use:
    Code:
    preg_replace("/\\\./", ".", "\[user@domain\.com\]");
    I tryed all kind of combinations with no result.

    Can someone help me with that?
    thanks!

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    tried stripslashes($string); ?
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.

  • #3
    Regular Coder
    Join Date
    Feb 2003
    Posts
    101
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Ökii
    tried stripslashes($string); ?
    stripslashes will remove ALL slashes, but I need them all, exept the one before " . "

  • #4
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,081
    Thanks
    11
    Thanked 99 Times in 97 Posts
    PHP Code:
    <?
    $str
    =str_replace('\.','',$string);
    ?>
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #5
    Regular Coder
    Join Date
    Feb 2003
    Posts
    101
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by firepages
    PHP Code:
    <?
    $str
    =str_replace('\.','',$string);
    ?>
    thank you!
    with little modification it worked as I wanted!
    P.S. what's wrong with PHP CODE on this forum? it strips slashes...
    it's nice see in color the code, but when it doesnt show everything, I'd prefere use [ code ]....[ /code ] instead...

    Thanks again!

  • #6
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,081
    Thanks
    11
    Thanked 99 Times in 97 Posts
    lol - sorry I did not check my post , the forum did indeed remove the all-important slash

    str_replace('\.','',$string);

    that or its Spookster who has a habit of editing my posts
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •