in that case...
code:
$path="c:\df\adsfvad\vwed"

$l=len($path)
$index=$l
$folder=""

while $index>0 and $folder=""
if substr($path,$index,1)="\"
$folder=substr($path,1,$index-1)
endif
$index=$index-1
loop
? $folder

_________________________
How to ask questions the smart way <-----------> Before you ask