#!/bin/sh

ROOT="$1"
LIST=`find $ROOT -type f -regex ".*\.\(php\|inc\)"`

for i in $LIST; do
	CONTENT=`cat $i | head -n 1 | egrep -vi "^<\?php$"`
	if [ -n "$CONTENT" ]; then
		echo $i
		echo "$CONTENT"
		echo
	fi
done
