You can create a "drop table" sql file by accessing the information_schema.tables table and selecting from it for the appropriate schema.
select concat('drop table ','table_name',';')
from information_schema.tables
where table_schema = '[my_schema_name]'
and table_name != '[the_table_I_don't_want_to_drop]'
INTO OUTFILE '[FILESPEC]';
If you would like to list a group of tables not to drop, simply change the and clause to "and table_name not in ('table1','table2',...'tableN')".
You could do the same thing in PHP. You would simply loop through the results and execute the resultant string.