URL File Name Extractor

By itsupportnotes on Apr 19, 2008

Ok here goes. This is a short snippit which will give you the file name at the end of the URL. The snippint uses the pathinfo function. I might make it a function in a few days.

<?php
$url = "enter a url here";
$path_parts = pathinfo($url);
$FileName = "".$path_parts['filename'].".".$path_parts['extension']."";
print "$FileName";
 ?>

Comments

Sign in to comment.
markusPHP   -  Jun 16, 2008

Useful

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.