Created
February 13, 2023 12:13
-
-
Save haymaker/e4056ec9376b58b0b0d33db65e7e7109 to your computer and use it in GitHub Desktop.
Simple Extract Class name from PHP FQN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function className(string $class): string | |
{ | |
return basename(str_replace('\\', DIRECTORY_SEPARATOR, $class)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment