[ACCEPTED]-Simple PHP string replace?-php
Accepted answer
Have a look at str_replace
$abc = ' Hello "Guys" , Goodmorning';
$abc = str_replace('"', '$^', $abc);
0
str_replace('"','$^',$abc);
Should work for you.
0
$abc = ' Hello "Guys" , Goodmorning';
$new_string = str_replace("\"", '$^', $abc);
echo $new_string;
output:
Hello $^Guys$^ , Goodmorning
0
preg_replace('/"/', '$^', $abc);
0
Searching the manual would have brought you to this: http://php.net/manual/en/function.str-replace.php
str_replace('"', '$^', $abc);
0
String replace function is used to replace 6 string. Your syntax is wrong. You have to 5 use php string function like below example. First of all, think 4 about first and two values and replace in 3 third. Let's have a look.
<?php
echo str_replace("Hello", "HI", "Hello Jack ");
?>
It produces the 2 output.
HI Jack.
You can create an HTML form and 1 change on button only.
<form>
input box 1
input box 2
input box 3
button
</form>
Another
str_replace('"','$^',$var);
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.