Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strip image name from URL string

Status
Not open for further replies.

mwcart

MIS
Sep 26, 2000
9
US
I need to strip the image name from a URL string in a file. I can handle very thing but how to handle stripping the image name from the URL. The image name is the only thing that will change in the string for each variable. Example


I would like to strip the imagename.gif

Any help is greatly appreciated

Mike
 
try:[tt]

$url = "$url =~ m~.*/(\w+\.\w+$)~;
$name = $1;[/tt]


or:[tt]

$name = (split('/', $url))[-1];[/tt]
"If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top