Re: ArrayPath

From: Date: Tue, 07 Oct 2014 17:22:16 +0000
Subject: Re: ArrayPath
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-77811@lists.php.net to get a copy of this message
That would cause some problems indeed. But you could scape as in other strings. at('a/\/b') not nice but we have the same for every string On Tuesday, October 7, 2014, Johannes Schlüter <johannes@schlueters.de> wrote: > On Tue, 2014-10-07 at 17:05 +0100, Mathias Grimm wrote: > > Hi, > > I would like to suggest something for php like a class I am using > > > > https://github.com/mathiasgrimm/arraypath > > > > The reason is to access arrays like this: > > > > $idx3 = ArrayPath::get('idx1/idx2/idx3', $_POST, 'myDefaultValue'); > > what hppens if my array has a / as part of the key? Do I have to check > that beforehand and set a custom identifier? So what happens if I use > your example with $_GET instead of $_POST and a user requests > foo.php?idx1=idx2/idx3 > > I'm not really convinced. > > johannes > >

« previous php.internals (#77811) next »