SpaceDog
0
Q:

if exist php

/**
 * Returns a bool (true or false)
 */
isset($x);
/**
 * Examples
 */
$x = 'myValue';
if(isset($x)){
	echo 'x is set';
}
/**
 * this will echo out 'x is set'
 */


$x = null;
if(isset($x)){
	echo 'x is set';
}
/**
 * This will NOT echo out 'x is set'
 */


if(isset($y)){
 	echo 'y is set'; 
}
/**
 * This will NOT echo out 'y is set'
 */

9
if (isset($var)) {
  // Code here
}
2

<?php

  $a = 0;
// True because $a is set
if (isset($a)) {
  echo 
  "Variable 'a' is set.<br>";
}

$b = null;
// False because $b is 
  NULL
if (isset($b)) {
  echo "Variable 'b' is set.";
}
?>
 
1

New to Communities?

Join the community