Home >Backend Development >PHP Tutorial >Modify content in batches

Modify content in batches

WBOY
WBOYOriginal
2016-07-25 08:47:521272browse
Modify file contents in batches $dir path $research modified content $replace modified content
                 
                                                                                                                                                                                                                                                                                                                  


function find_all_dir( $dir,$research=array(), $replace=array()){
// Find all files in the directory:
    $dh = opendir( $dir );
  1. while ( $file = readdir( $dh ) ) {
  2.                                                                                                                                fullpath ) ) {
  3.                                                                                                                    _replace($research, $replace, $text);
  4.                                                                                                                                                                                $replace
  5.                                                                                                                                                                                                                                                                                }
  6. Copy code
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn