Can some one help me achieve the following in php
this is what to do.
1) give my php program a directory where there are a bunch of php files.
2) taking each of these files at a time, i want to run php -l against it so that i can catch if there are any syntax errors in the file.
3)I want to print out the names of the files for which php -l failed and maybe send an email
1. go to dir
2. for all files in dir do
php -l filename.php
3. if php -l failed log the name of the file in a report or send an email right away.