Skip to content

Instantly share code, notes, and snippets.

@cmfcmf
Created August 5, 2014 11:26
Show Gist options
  • Save cmfcmf/78b65318994660d6665e to your computer and use it in GitHub Desktop.
Save cmfcmf/78b65318994660d6665e to your computer and use it in GitHub Desktop.
Remove soft hypens in all files
{
"name": "root/tmp",
"require": {
"symfony/finder": "*"
},
"authors": [
{
"name": "cmfcmf"
}
]
}
<?php
require('vendor/autoload.php');
use Symfony\Component\Finder\Finder;
$finder = new Finder();
$finder->files()->in(__DIR__ . '/MostGenerator');
foreach ($finder as $file) {
$path = $file->getRealpath();
$text = file_get_contents($path);
file_put_contents($path, str_replace('­', '', $text));
}
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment