$path = “protected/musics/composer/album/song.mp3”;
I can extract the file name with the use of basename() function.
$path = basename($path, “.mp3”);
Also I want to extract the last two directory names in a variable
example
$composer_name = composer //(extracted from the path $path);
$album_name = album //(extracted from the path $path)
Could you please someone help me out of this? Thanks in advance.
For what it’s worth, you could also ‘walk’ up the directory structure grabbing the basename as you go (though a one-liner like crmalibu’s always goes down well).
Regarding “omg how can i build facebook give me the codez”, no-one has ever answered that ‘question’ yet which is probably why it keeps getting asked! (: