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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Posts
    257
    Thanks
    8
    Thanked 0 Times in 0 Posts

    use srt_replace many times

    Hi,

    I have the following code:

    PHP Code:
    str_replace('Hello',$hi,$category);
    str_replace('****',$code,$category);
    str_replace('wtf',$code2,$category); 
    For strange reasons only it replaces the first element. How can I do in order that replaces all the variables?

    Best Regards

  • #2
    Senior Coder
    Join Date
    Jul 2005
    Location
    New York, NY
    Posts
    1,084
    Thanks
    4
    Thanked 19 Times in 19 Posts
    PHP Code:
    $category str_replace('Hello',$hi,$category);
    $category str_replace('****',$code,$category);
    $category str_replace('wtf',$code2,$category); 


  •  

    Posting Permissions

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