I have the following path: c:\useless\nameiwant\moreuseless
How would I pull 'nameiwant' from the file path above?
Any help is appreciated.
explode
If it's always the last directory name, you can do:
$dirName = basename(dirname($filePath));
Thanks!