Use fileparts and you will get the directory without using any / or explode usage.
[code:1:059164e278]>> fullpath
fullpath = /home/user/www/site/trunk/tempuploads/test/174_bw_tractsresize.png
>> [pathstr, name, ext] = fileparts(fullpath)
pathstr =
/home/user/www/site/trunk/tempuploads/test
name =
174_bw_tractsresize
ext =
.png[/code:1:059164e278]
Leave a Reply