Re: New function proposal urlappendvar()

From: Date: Wed, 21 Jan 2004 12:07:28 +0000
Subject: Re: New function proposal urlappendvar()
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-7238@lists.php.net to get a copy of this message
At 07:53 PM 1/21/2004 +0800, James Devenish wrote:
In message <Pine.LNX.4.58.0401210328110.1105@thinkpad.lerdorf.com> on Wed, Jan 21, 2004 at 03:31:08AM -0800, Rasmus Lerdorf wrote:
$url = urlappendvar($_SERVER['HTTP_REFERER'], 'foo', $foo);
Generally we don't add functions to replace simple one-line PHP expressions. $url .= strstr($url,'?')?"?foo=$foo":"&foo=$foo"; Without wanting to make any comment about the merits of the proposed function, I would have thought there would be merit in having a set of generalised URL-manipulation functions (if someone wanted to write them, that is). For example, the urlappendvar function would clearly handle the syntax of URLs transparently, yet the one-liner requires an author to do The Right Thing in a piecemeal fashion.
I agree that it might be a good idea. There are only two problems: a) The name of the function. b) The timing (we are in a feature freeze right now). I suggest you bring it up again once we release 5.0.0. I'm sure that it has the potential to spawn an intellectual discussion on what the function should look like and other features which are often needed (i.e. it might become something more interesting). Andi

« previous php.internals (#7238) next »