Skip to content

Instantly share code, notes, and snippets.

@vdite
Created August 30, 2013 16:13
Show Gist options
  • Save vdite/6391520 to your computer and use it in GitHub Desktop.
Save vdite/6391520 to your computer and use it in GitHub Desktop.
replaces given string in a bunch of files inside an folder with php
<?php
foreach(glob('./*.html') as $filePath) {
$file_contents = file_get_contents($filePath);
$file_content_replace = preg_replace('windows','linux',$file_contents);
file_put_contents($filePath,$file_content_replace);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment