1<?php
2//str_replace("Original Value", "Value to be replaced", "String");
3$result = str_replace("1", "2", "This is number 1");
4// Output: This is number 2
5?>
1$var1 = 'hello.world';
2$var2 = str_replace(".", "-", $var1);
3echo $var2; // hello-world
4
1<?php
2 $string = "Hello PHP";
3 $replace = str_replace("PHP", "JS", $string);
4 echo $replace; // Hello JS
5?>