PHP str_replace() string function

The str_replace() function in PHP

The str_replace() function used to replace one string with some another string.

str_replace() function syntax

str_replace(“search for”, “replace”, “original string”);

PHP str_replace() function example

The str_replace() function output is

Replaced string = Academy Meera Academy

In above example the word “hello” replaced by “academy” so out put new string is “Academy Meera Academy”.

php example of str_replace string function.

PHP str_replace string function example out put screen like:

PHP str_replace() string fuction
PHP str_replace() string fuction

In above string function example we input “Hello Meera Academy” text in textbox and the word “Hello” replaced by word “Academy” using str_replace php string function.

Leave a Reply

Your email address will not be published. Required fields are marked *