Project

General

Profile

SnipPets » History » Version 1

Simon, 10/14/2009 06:19 PM

1 1 Simon
= Snippets = 
2
3
== Remove trailing whitespaces ==
4
5
http://jimbojw.com/wiki/index.php?title=How_to_find_PHP_files_with_trailing_whitespace
6
7
'''Command Line :''' 
8
{{{
9
echo '<?php foreach (glob("**/*.php") as $file){if (preg_match( "/\\?".">\\s\\s+\\Z/m", file_get_contents($file))) echo("$file\n");} ?>' | php
10
}}}
11
12
13
'''PHP file script :'''
14
{{{
15
<?php
16
foreach (glob('**/*.php') as $file){
17
  if (preg_match('/\\?'.'>\\s\\s+\\Z/m',file_get_contents($file)))
18
    echo("$file\n");
19
}
20
?>
21
}}}