You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
376 B
PHP
17 lines
376 B
PHP
<?php
|
|
/*
|
|
Make a PHP array from the mimetypes.csv file
|
|
*/
|
|
$file = file_get_contents("mimetypes.csv");
|
|
$lines = explode("\n", $file);
|
|
$output = "[\n";
|
|
foreach ($lines as $l) {
|
|
$line = explode(",", $l);
|
|
for ($i = 1; $i < count($line); $i++) {
|
|
$output .= "\t\"" . $line[$i] . "\" => \"" . $line[0] . "\",\n";
|
|
}
|
|
}
|
|
$output .= "]";
|
|
|
|
file_put_contents("mimetypes.php", $output);
|