str_replace php
snippet in php

php str_replace

user3003

<?php
//str_replace("Original Value", "Value to be replaced", "String");
$result = str_replace("1", "2", "This is number 1");
// Output: This is number 2
?>

php string replace

user3561


<?php

echo str_replace("world","Peter","Hello world!");

?> 

php replace

user4837

str_replace ($search, $replace, $subject);

str_replace php

user6190

echo str_replace("worss","world","Hello worss in PHP!!");

php replace every occurrence of character in string

user9735

//replaces every occurence of $search with $replace in the string $subject
str_replace ($search, $replace, $subject);

replace all php

user7441

$vowels = array("a", "e", "i", "o", "u", "A", "E", "I", "O", "U");
$onlyconsonants = str_replace($vowels, "", "Hello World of PHP");
// Fornece: Hll Wrld f PHP