Re: Easier way to clean GET Variables ?

From: Date: Thu, 25 Aug 2005 08:02:20 +0000
Subject: Re: Easier way to clean GET Variables ?
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-221328@lists.php.net to get a copy of this message
Burhan Khalid wrote:
Jasper Bryant-Greene wrote:
Robert Cummings wrote:
[snip] Still need to check isset() status unless you've disabled E_NOTICE which I don't advise since it's sloppy ;)
Yeah, I usually would in a real script. Just slipped my mind when writing that example.
I would also in a real script, not use $_MyVar.
Would you care to elaborate with some reasons for this? I find it very useful as a naming convention for any sort of "external variable" or user input, so when reading my code I can immediately tell what came from where. Prepending the variable name with an underscore happens to be what PHP does ($_SERVER, $_GET, $_POST, $_COOKIES, so on...) so it is simpler just to carry on that convention. Jasper

« previous php.general (#221328) next »