Location: PHPKode > scripts > File Scope Replacer > file-scope-replacer-0-1/script_test.php
<?php

require_once('FileScopeReplacer.php');

$params = array();

//--------------- configuration --------------

// directory where files will be searched to replace
$params['dir'] = '.';

// set to 1 if you want to proceed also nested directories
$params['include_nested'] = 0;

// this is string of what you are looking for
$params['search_what'] = 'test';

$params['replace_to'] = '[this place have been replaced]';

// setting for filtering, set '' if no filtering,
// otherwise thi is regexp expression like: '/your_regexp/flags', 
// see http://www.php.net/manual/en/pcre.pattern.syntax.php
$params['file_name_match'] = '/^test/';  // <-- this mean beginning from 'test'


//--------------- end configuration --------------

$replacer = new FileScopeReplacer( $params );
$replacer->doWork();

echo 'Was processed '.count($replacer->processed_files).' file(s).'."\n";
foreach( $replacer->processed_files as $file_path ){
  echo $file_path."\n";
}

?>
Return current item: File Scope Replacer