Use SQL. Here is how I would do it.
When a new score comes in do a select on the database for the minimum score to get into the top20.
PHP Code:
SELECT MIN(score) FROM myTable;
If new score > min, insert new score into the database and delete the min score.
The only thing is you would have to do two queries to delete the min score from the database something like
PHP Code:
minId = SELECT id FROM myTable WHERE score = (SELECT min(score) FROM myTable)
DELETE FROM top20 WHERE id = minId
Then all you have to do is selects on that table if you are looking for the top20
PHP Code:
SELECT * FROM top20 ORDER BY score DESC
You probably could get the ID and delete it from the database all in one query but this should be fast enough.