On 5/6/08, lilmouseman <[EMAIL PROTECTED]> wrote:
>
> Hi Everyone. First time poster.
>
>  My question is about extracting part of a path from the right.
>
>  e.g. folder/images/testimage.jpg
>
>  how do I get everything from the right all the way up to the first "/"
>
>  Thank you in advance.
>

Hi and welcome.
Try something like this:
$path = 'folder/images/testimage.jpg';
substr($path, strpos($path, '/'));

This will give you: /images/testimage.jpg

If you don't need the first / :
substr($path, strpos($path, '/')+1);
This will give: images/testimage.jpg

regards
mmlado

Reply via email to