RyanFox Posted August 19, 2014 Share Posted August 19, 2014 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 Quote Link to comment Share on other sites More sharing options...
Solution RyanFox Posted August 19, 2014 Author Solution Share Posted August 19, 2014 Never mind, I have fixed it. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.