find directory -not \( -name temp -o -name 3.php -o -name c -prune \) -delete
A quick test case showed that it worked on this exact case, at least. If there are subdirs named e.g. c or such, I believe you might exclude them as well. It's easy to get it to work in general cases, but to define a find command in all generality takes some testing.
Test without the "-delete" statement to see which files it matches.
PRESSTOP: find changes its behaviour when -delete is specified (find warns about this and won't go on when -prune is specified). You could always pipe output to xargs and rm, or write -execdir rm {} \; instead of -delete, though.
Examples:
find directory -not \( -name directory -o -name 3.php -o -name c -prune \) -execdir rm -r {} \;
find directory -not \( -name directory -o -name 3.php -o -name c -prune \) -print0 | xargs -0 rm -r
It's always tricky business, and when the goal is to delete files, make extensive test cases. I have quite a few similar finds running nightly, and I can't say I wasn't nervous setting them free :-)