Hello,
I have multiple str_replace with file_put_contents in my script and it only seems to run the last str_replace.
If I remove the last one it runs the first one fine.
Code:
$file_name = "txt.txt";
$contents = file_get_contents($file_name);
//first
$updom = str_replace("google.com",$domain,$contents);
file_put_contents($file_name, $updom);
//last
$upip = str_replace("74.125.226.110",$ip,$contents);
file_put_contents($file_name, $upip);
google.com and that ip are just for testing.
If I run that the ip one works but not the domain one, if I comment out the IP one the domain one works fine...
What is going on?
Thanks,
Ryan