Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to replace a text with a string?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 84
    Comment on it

    To replace a text with a string a function str_replace() is used. It replaces all the occurences of the string that you have searched with the string you want to give in that place. For example:

    <?php
    $str = "String in which you replace the string" ;
    $str = str_replace(' ', '_', $str);
    echo $str
    ?>
    

    The above code will display the following output:

    String_in_which_you_replace_the_string
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: