Reputation:
I am trying to change a string with str_replace()`.
str_replace("****",$res->id,$my_file);
But it is not changing the string. I don't know how to debug the scenario.
Upvotes: 0
Views: 300
Reputation: 318468
You need to assign the returned string to your variable. None of PHP's *_replace
functions modify the original string in-place.
$my_file = str_replace("****", $res->id, $my_file);
Upvotes: 4