Write a PHP script to extract the file name from the following string.
Sample String : 'www.example.com/public_html/index.php'
Pictorial Presentation:
<?php $path = 'www.example.com/public_html/index.php'; $file_name = substr(strrchr($path, "/"), 1); echo $file_name."\n"; // "index.php" ?>
Sample Output:
index.php
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