public static function massStrReplaceFile(string $find, string $replace, string $path)
    {
        $dir = opendir($path);
        while (false !== ($file = readdir($dir))) {
            if (($file != '.') && ($file != '..')) {
                if (is_dir($path . '/' . $file)) {
                    static::massStrReplaceFile($find, $replace, $path . '/' . $file);
                } else {
                    static::strReplaceFile($find, $replace, $path . '/' . $file);
                }
            }
        }
        closedir($dir);
    }
public static function massStrReplaceFile(string $find, string $replace, string $path)
    {
        $dir = opendir($path);
        while (false !== ($file = readdir($dir))) {
            if (($file != '.') && ($file != '..')) {
                if (is_dir($path . '/' . $file)) {
                    static::massStrReplaceFile($find, $replace, $path . '/' . $file);
                } else {
                    static::strReplaceFile($find, $replace, $path . '/' . $file);
                }
            }
        }
        closedir($dir);
    }
public static function massStrReplaceFile ( string $ find , string $ replace , string $ path ) { $ dir = opendir ( $ path ) ; while ( false !== ( $ file = readdir ( $ dir ) ) ) { if ( ( $ file != '.' ) && ( $ file != '..' ) ) { if ( is_dir ( $ path . '/' . $ file ) ) { static :: massStrReplaceFile ( $ find , $ replace , $ path . '/' . $ file ) ; } else { static :: strReplaceFile ( $ find , $ replace , $ path . '/' . $ file ) ; } } } closedir ( $ dir ) ; }
Replace a string from each file in a given directory.

@author Erik Campobadal Fores <soc@erik.cat>
@copyright 2017 erik.cat
@param string $find
@param string $replace
@param string $path
@return void
Replace a string from each file in a given directory .