[thelist] PHP string manipulation

Kelly Hallman khallman at wrack.org
Thu Jun 26 23:29:32 CDT 2003


On Fri, 27 Jun 2003, Frijo Franco wrote:
> $path="Directory_One/Directory_Two/FileName1.zip";
> echo $path["dirname"]."/";

Actually, I think you mean
$path = "Directory_One/Directory_Two/FileName1.zip";
$dir = dirname($path)."/";

So, it's actually quite simple, using the built-in dirname() function.
Also, check out basename() to get the filename component.

-- 
Kelly Hallman
http://wrack.org/





More information about the thelist mailing list