Re: Easier way to clean GET Variables ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux