Thursday, 21 February 2013

str replace for replacing str

<?php
$arr = array("ram","shyam","sita","gita");
print_r(str_replace("shyam","ramesh",$arr,$i));
echo "Replacements: $i";
?>
The output of the code above will be:
Array
(
[0] =>ram
[1] =>ramesh
[2] =>sita
[3] =>gita
)
Replacements: 1

No comments:

Post a Comment