Here's a PHP array with the 996 extensions defined in Apache's mime.types file (built with node-mime). If you want JSON and have node.js
installed, just npm install mime
then:
node -e "console.log(JSON.stringify(require('./mime').extensions))"
Edit: The node mime-db project now maintains a current, CDN-hosted, JSON file of mime-types. The one caveat is that this file includes additional meta-data about each type you may not need. That's probably only important if you care about the JSON file size though.