At 12:16 PM -0500 4/15/07, Larry Garfield wrote:
If you want your syntax to be a bit simpler, I frequently use helper functions
along these lines:

function http_get_int($var, $default=0) {
  return isset($_GET[$var]) ? (int) $_GET[$var] : $default;
}

if (http_get_int('var') ==5) {
  // Do stuff
}

Clean to read, easy defaults, (reasonably) type-safe, and E_NOTICE friendly.

Larry:

Slick.

Thanks,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

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

Reply via email to