-4

Possible Duplicate:
How to get file name from full path with PHP?

File Path :

users_gallery/2012/August/14-August-2012/8/Sasasas/b_80.27016000 134489509114 08 2012kites-4v.jpg

I there any way to take out the file name:

b_80.27016000 134489509114 08 2012kites-4v.jpg
Community
  • 1
  • 1

2 Answers2

0

Use php basename funcion http://php.net/manual/en/function.basename.php

raygo
  • 1,348
  • 5
  • 18
  • 40
-1
$arr = explode('/', 'users_gallery/2012/August/14-August-2012/8/Sasasas/b_80.27016000 134489509114 08 2012kites-4v.jpg');
$file = $arr[count($arr) - 1];
echo $file;

This should echo b_80.27016000 134489509114 08 2012kites-4v.jpg

Kenny Cason
  • 12,109
  • 11
  • 47
  • 72