Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use str_replace () function in php ?

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 139
    Comment on it

    What is utilization of str_replace () function ?

    there are 3 main uses of str_replace () function in php.

    1-str_replace() function supersedes some characters with some other characters in a string.

    2-str_replace() Supersede all occurrences of the search string with the suppression string.

    3-str_replace() function returns a string or an array with the superseded values.

    you can see below example of str_replace () function:

    <?php
    //here call the  str_replace() function for replace text
    echo str_replace("Fine", "Mac", "Hi Fine"); 
    ?>
    

    Here "fine" text is repleced by "Hi"

    So,output will come:

    Hi Mac

 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: