The command inserts a tag to the beginning of a file:
sed -i "1s/^/<?php /" file
How can I insert something to the end of each file with SED?
Assuming you want to put the ending php tag to the files, then
should do the trick
See your original post http://superuser.com/questions/36575/unix-add-a-tag-to-the-beginning-of-each-file for the all in one sed command.