For Example let the path be,
$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.