programming-examples/php/String/PHP script to extract the file name from the following string..php
2019-11-15 12:59:38 +01:00

5 lines
143 B
PHP

<?php
$path = 'www.example.com/public_html/index.php';
$file_name = substr(strrchr($path, "/"), 1);
echo $file_name."\n"; // "index.php"
?>