Write a PHP script to get the filename component of the following path.
Sample path : "https://www.w3resource.com/index.php"
<?php $path = 'www.example.com/public_html/index.php'; $file = basename($path, ".php"); echo $file."\n"; ?>
Sample Output:
index
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer