Re: New function proposal urlappendvar()

From: Date: Wed, 21 Jan 2004 11:53:07 +0000
Subject: Re: New function proposal urlappendvar()
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-7235@lists.php.net to get a copy of this message
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.

« previous php.internals (#7235) next »