I am trying to work with an external array that should transform my file endings into another string:
This is my fileTypes.php:
return array(
'mp3' => 'fa-music',
'jpeg' => 'fa-picture-o',
);
And this is my index.php:
$fileTypes = require('fileTypes.php');
$file = "mymusic.mp3"
$fileExt = strtolower(pathinfo($file, PATHINFO_EXTENSION));
echo $fileTypes['fileExt'];
I do not really get it run. I must have some basic problem in understanding :(
I get an empty result. But the result I wish is fa-music.
$fileExtas index and not the stringfileExt(Add error reporting:ini_set("display_errors", 1); error_reporting(E_ALL);)