PHPverse 2025

Voting

: eight plus one?
(Example: nine)

The Note You're Voting On

kiril (AT) aternus networks
7 years ago
If you want the Class Name without the Namespace or if you've got here because basename() returns a dot (.) for the FQCN (Fully Qualified Class Name), here is the solution:

<?php
// FQCN: App\Http\Controllers\CustomerReportController

substr(self::class, (int)strrpos(self::class, '\\') + 1)

// returns: CustomerReportController
?>

<< Back to user notes page

To Top