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

Modify content in batches

WBOY
Release: 2016-07-25 08:47:52
Original
1259 people have browsed it
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
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template