-->

  • str-replace() - Replace Text Within a String






    In this blog, we will teach you about PHP ucwords() function. Basically we have also teach about basics of PHP 7 . so, you will go to our previous Blog for learn about PHP and for your kind information we also have a YouTube channel, which we continuously uploaded videos of HTML, CSS, PHP and Tech Videos. so please subscribe to our YouTube channel.


    YouTube Channel :-  Kumar Atul Jaiswal


    str_replace() - Replace Text Within a String



    The str_replace() is a built-in function in PHP and is used to replace all the occurrences of the search string or array of search strings by replacement string or array of replacement strings in the given string or array respectively. str-replace() - Replace Text Within a String

    or

    The PHP str_replace() function replaces some characters with some other characters in a string.



    Syntax 


    str_replace(find, replace, string, count)


    In the table below, each parameter of the function is described separately for you to get a better idea:



            Parameter  Description


    • find          Necessary. Defines the value that has to be found.

    • replace Necessary. Defines the replacement value.

    • string Necessary. Specifies a string where the search will take place.

    • count Not necessary. Sets a variable that counts the changes made.

       

       


     <!DOCTYPE html>
    <html>
    <head>
    
    <title> PHP  str_replace () Function </title>
    
    </head>
    <body>
    
    <h1> </h1>
    
    
    <?php
    
    
    
    echo str_replace("world", "Kumar Atul jaiswal", "Hello world!");
    
    echo "<br>";
    
    echo str_replace("HackerBoY","paypal","Hello HackerBoY!"); 
    
    ?>
    
    
    </body>
    </html>
    
    




    Output 



    Hello Kumar Atul jaiswal!

    Hello paypal!





    NOTE :- Video on This Topic :- Soon





    Have a Nice Stay Here : - )




  • 0 comments:

    Post a Comment

    For Any Tech Updates, Hacking News, Internet, Computer, Technology and related to IT Field Articles Follow Our Blog.