programming-examples/php/String/PHP script to get the filename component of the following path..php

5 lines
112 B
PHP
Raw Normal View History

2019-11-15 12:59:38 +01:00
<?php
$path = 'www.example.com/public_html/index.php';
$file = basename($path, ".php");
echo $file."\n";
?>