Skip to content

Instantly share code, notes, and snippets.

@haymaker
Created February 13, 2023 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haymaker/e4056ec9376b58b0b0d33db65e7e7109 to your computer and use it in GitHub Desktop.
Save haymaker/e4056ec9376b58b0b0d33db65e7e7109 to your computer and use it in GitHub Desktop.
Simple Extract Class name from PHP FQN
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