ok, I have several thousand files that needs some lines of code inserted at the very top of each file. the files are php files so i need something written in perl or php that will recursively search for files named .php, open them and insert code that i designate at the very top of each php page. i would like for this to have a web based front end, however command line is ok as well. basically, i have many directories beneath for instance, /news that has all of these php files that need edited.
so to manually edit , "/news/2001/jan/01" etc etc would be very cumbersome. so i need to have a script to start off in a directory such as /news/2001 and recursively perform the actions specified above.