Source Code:
(back to article)
<?php echo basename("/path/to/file.txt") . PHP_EOL; // Outputs: file.txt echo basename("/path/to/file.txt", ".txt") . PHP_EOL; // Outputs: file echo basename("/path/to/directory/"); // Outputs: directory
Result:
Report an issue