I have a image path like this..
2012/12/14/example.jpg
Now I would like to get the path except image name..
I mean I need like this
2012/12/14/
Can anyone help me? Thanks
I have a image path like this..
2012/12/14/example.jpg
Now I would like to get the path except image name..
I mean I need like this
2012/12/14/
Can anyone help me? Thanks
I guess this is what you need
<?php
$path_parts = pathinfo('2012/12/14/example.jpg');
echo $path_parts['dirname'], "\n";
echo $path_parts['basename'], "\n";
echo $path_parts['extension'], "\n";
echo $path_parts['filename'], "\n";
?>
output will be..
/www/htdocs/inc
example.jpg
jpg
example