Posted on 29/1/09 by Felix Geisendörfer
Today I needed a list of mime types and extensions to determine the proper extension to assign to a file with a certain mime type. It wasn't difficult to find one.
However, as always when looking for tables and stuff like this on the web, I had to convert the data for using it in PHP. Usually I'd use my text editor and a few regex for the job.
But not today. Today was the last time I wasted energy on importing trivial data sets into PHP.
Why? Well, because I believe there is a fortune lost in man hours in the process on a daily basis. It is time for stopping that.
It is time for a new project called php arrays. (Warning: don't open anything but extensions.php / mime_types.php in your browser, it may freeze due to client-js syntax highlighting. Click the download link of the whole repo instead.).
Basically it is just a collection of PHP arrays, each containing one big array. So far I have done a little work in making two generators that currently produce the following arrays: big_cities.php (population > 15000), countries.php, extensions.php, mime_types.php and time_zones.php. Whenever I need to work with other stuff I'll add it there as well.
Now it is time for you to join the fun and share PHP arrays you generated or aggregated in the past. Fork the project on GitHub or send me a link to your array paste.
-- Felix Geisendörfer aka the_undefined
PS: What other arrays would like to see added to the collection in future?
You can skip to the end and add a comment.
This post is too old. We do not allow comments here anymore in order to fight spam. If you have real feedback or questions for the post, please contact us.