Simple PHP string replace?

Solution:1

Have a look at str_replace

$abc = ' Hello "Guys" , Goodmorning';
$abc = str_replace('"', '$^', $abc);

Solution:2

$abc = ' Hello "Guys" , Goodmorning';

$new_string = str_replace("\"", '$^', $abc);
echo $new_string;

output:

Hello $^Guys$^ , Goodmorning

Solution:3

String replace function is used to replace string. Your syntax is wrong. You have to use php string function like below example. First of all, think about first and two values and replace in third. Let’s have a look.

<?php
echo str_replace("Hello", "HI", "Hello Jack "); 
?>

It produces the output.

HI Jack.

You can create an HTML form and change on button only.

<form> 
input box 1 
input box 2 
input box 3 
button 

</form>

Another

 str_replace('"','$^',$var);