I want to edit 100 php files in different folders using php. I have searched on google but doesn't get any help. I want to replace some text with other text on every file. Tell me a suitable way to do it using php.
For eg. I have two texts t1 ,t2 and i want to replace it with v1,v2 in every file how to do it?.
sedon the command line, but you run the risk of making unexpected changes if you are not careful. Alternatively, let your tools do the heavy lifting: have a look at your favourite IDE/file editor - it might have multi-file search and replace? For instance, Sublime Text hasFind in Files..feature that allows multi-file search and replace, optionally with regex pattern matching. As advised below, I would take an incremental approach - do not blindly run a destructive process on your files!