[thelist] PHP string manipulation

Frijo Franco frijo.franco at megasoft.com
Thu Jun 26 23:43:39 CDT 2003


sorryyyyy there was a function line missing

 $path=pathinfo("Directory_One/Directory_Two/FileName1.zip");

 echo $path["dirname"]."/";
thanks for that
frijo

-----Original Message-----
From: Kelly Hallman [mailto:khallman at wrack.org]
Sent: Friday, June 27, 2003 10:00 AM
To: thelist at lists.evolt.org
Cc: frijo.franco at megasoft.com; Mark.Joslyn at SolimarSystems.com
Subject: RE: [thelist] PHP string manipulation


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/

-------------- next part --------------
This mail has been scanned for viruses by InterScan Viruswall.

Information contained and transmitted by this E-MAIL is proprietary to Megasoft Ltd and is intended for use only by the individual or entity to which it is addressed and may contain information that is privileged, confidential or exempt from disclosure under applicable law.If you received this message in error or are not the intended recipient, you should destroy the e-mail message and any attachments or copies, and you are prohibited from retaining, distributing, disclosing or using any information contained herein. Please inform us of the erroneous delivery by return e-mail to mailadmin at megasoft.com.



More information about the thelist mailing list