How to get just the name of the parent folder in the directory where a script is running in php?
<p>I would like to get just the name of the parent folder of which a script is currently running in the directory?</p>

<p>if we have a script called foo.php with a path of "/Users/Somone/Sites/public/foo.php", how can i go about just getting "public"out of the that file path and not the entire directory tree?</p>

<p>any help would be great. </p>

<p>thanks.</p>
