Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #16362
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: Handling parts of paths and directory names in PHP |
| Date | 2016-02-05 21:15 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <87io22kgfe.fsf@bsb.me.uk> (permalink) |
| References | <n92n9n$3gq$1@dont-email.me> |
James Harris <james.harris.1@gmail.com> writes: > Do you guys have any generic recommendations on how to store paths > based on your experience of handling paths in PHP? <snip> > When handling such path parts as strings there are issues over whether > to store slash characters at the start and end of a part or whether to > add the slash when they are combined. Related, is avoiding a resultant > path having a double slash (i.e. //) at any point. I would not store the slashes. When I store paths as an array of components I store absolute paths with a "" as the first one. Then the full path is just a join operation. > These are mainly standard programming issues. I just wondered if you > guys had come up with a consistent approach or whether you approach > each problem separately. > > So, any recommendations as to whether to store each part of a path as > a string or an array in PHP? If you think it's worth it, wrap it in a class so you can easily change your mind about that. (I presume there's a typo in the question, though. If not, I've got the wrong end of the stick again.) -- Ben.
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Handling parts of paths and directory names in PHP James Harris <james.harris.1@gmail.com> - 2016-02-05 17:51 +0000
Re: Handling parts of paths and directory names in PHP Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-02-05 21:15 +0000
Re: Handling parts of paths and directory names in PHP James Harris <james.harris.1@gmail.com> - 2016-02-05 22:28 +0000
Re: Handling parts of paths and directory names in PHP "Peter H. Coffin" <hellsop@ninehells.com> - 2016-02-08 13:13 -0600
Re: Handling parts of paths and directory names in PHP Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-02-08 21:27 +0000
Re: Handling parts of paths and directory names in PHP Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-02-09 00:09 +0100
Re: Handling parts of paths and directory names in PHP Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-08 19:34 -0500
csiph-web