How to remove the rest of a folder path in PHP
<p>i have displayed the follow folders from my ftp it is taking it out correctly but i am trying to display the last folder is there anyway of doing this e.g str_replace but the is not exactly what i am looking for.</p>

<pre><code>    httpdocs/user_images/ 
e.g user_images

    httpdocs/user_images/home 
e.g home

    httpdocs/user_images/home/lastest 
e.g lastest

    httpdocs/user_images/home/lastest/monday 
e.g monday

    httpdocs/user_images/home/lastest/friday 
e.g friday
</code></pre>
