note 104608 modified in function.isset by danbrown

From: Date: Sat, 25 Jun 2011 11:37:27 +0000
Subject: note 104608 modified in function.isset by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-180949@lists.php.net to get a copy of this message
Useful to check if the variable have some value...specially for GET POST variables <?php function isset_or(&$check, $alternate = NULL) { return (isset($check)) ? (empty($check) ? $alternate : $check) : $alternate; } function getGETPOST($var) { return isset_or($_GET[$var],isset_or($_POST[$var],"Empty")); } ?> Example echo getGETPOST('na'); //Find the na varriabl by get and post --was-- Useful to check if the variable have some value...specially for GET POST variables function isset_or(&$check, $alternate = NULL) { return (isset($check)) ? (empty($check) ? $alternate : $check) : $alternate; } function getGETPOST($var) { return isset_or($_GET[$var],isset_or($_POST[$var],"Empty")); } ?> Example echo getGETPOST('na'); //Find the na varriabl by get and post http://php.net/manual/en/function.isset.php

« previous php.notes (#180949) next »