User Tools

Site Tools


uphp:functions:isset

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:isset [2017/03/18 19:37]
jeff
uphp:functions:isset [2021/09/13 05:57] (current)
Line 1: Line 1:
 ======isset====== ======isset======
 +
 <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge>
  
-Return 1 if the variable exists+Check if variable exists
  
 ====Description==== ====Description====
-<well size="sm"><html><span style="font-size:125%;color:green;">int + 
-<span style="color:black;"></html>[[isset]] +<well size="sm"><html> 
-<html>+<span style="font-size:125%;color:green">int 
-<span style="color:green;">mixed +<span style="color:black">isset ( 
-<span style="color:blue;">$variable +<span style="color:green">mixed 
-<span style="color:black;">)+<span style="color:blue">$variable 
 +<span style="color:black">)
 </html></well> </html></well>
  
 Determine if a variable is set Determine if a variable is set
  
-====Parameters==== +====Parameter====
-<html><span style="color:blue;"><b>variable</b><span style="color:black;"></html>:  Variable to check for existence((Multiple parameters are not supported as in mainline PHP))+
  
-====Return Value==== +<html><b><span style="color:blue">$variable<span style="color:black"></b></html>:  Variable to check for existence((Multiple parameters are not supported as in mainline PHP)) 
-1 (true) if variable exists, 0 (false) if variable does not exist+ 
 +====Return Values==== 
 + 
 +<html><b><span style="color:green">Integer<span style="color:black"></b></html>:  1 (true) if variable exists, 0 (false) if variable does not exist
  
 ====Examples==== ====Examples====
 +
 <code php> <code php>
 <? <?
Line 45: Line 50:
 ====Notes==== ====Notes====
  
-There is no way to unset a variable once it has been set (except to exit the local scope or script where it was defined). Unlike mainline PHP, uPHP does not have a construct ''unset()'' or the constant ''null''. Unlike many other programming languages, you cannot simply remove a variable by setting it equal to nothing, such as by trying the statement ''$x=;''((As tested on a Wattmon Pro with firmware 1.1051 the statement ''$x=;'' causes a Watchdog Timeout error and a reboot of the Wattmon)).+There is no way to unset a variable once it has been set (except to exit the local scope or script where it was defined). Unlike mainline PHP, uPHP does not have a construct ''unset()'' or the constant ''null''. Unlike many other programming languages, you cannot simply remove a variable by setting it equal to nothing, such as by trying the statement ''$x=;''((As tested on a [[hardware:wattmons:WattmonPRO]] with firmware 1.1051 the statement ''$x=;'' causes a Watchdog Timeout error and a reboot of the Wattmon)).
  
 Also note that the uPHP [[isset()]] does not always generate a parsing error if the parameter is not a variable((See http://php.net/manual/en/function.isset.php where it says "Warning: isset() only works with variables as passing anything else will result in a parse error.")). All of these examples will return 0: Also note that the uPHP [[isset()]] does not always generate a parsing error if the parameter is not a variable((See http://php.net/manual/en/function.isset.php where it says "Warning: isset() only works with variables as passing anything else will result in a parse error.")). All of these examples will return 0:
Line 75: Line 80:
  
 ====See Also==== ====See Also====
-[[is_int()]] - Return 1 if the variable is an integer 
  
-[[is_float()]] - Return 1 if the variable is a float+[[is_int()]] - Check if a variable is an <html><b><span style="color:green">integer<span style="color:black"></b></html> 
 + 
 +[[is_float()]] - Check if variable is a <html><b><span style="color:green">float<span style="color:black"></b></html>
  
-[[is_numeric()]] - Return 1 if the value is numeric (integer, float or numeric string)+[[is_numeric()]] - <html>Check if value is numeric (<b><span style="color:green">int<span style="color:black"></b><b><span style="color:green">float<span style="color:black"></b> or numeric <b><span style="color:green">string<span style="color:black"></b>)</html>
  
-[[is_array()]] - Return 1 if the variable is an array+[[is_array()]] - Check if variable is an <html><b><span style="color:green">array<span style="color:black"></b></html>
  
-[[is_string()]] - Return 1 if the variable is a string+[[is_string()]] - Check if variable is a <html><b><span style="color:green">string<span style="color:black"></b></html>
  
 [[uphp:variables|uPHP Variable Types and Limits]] [[uphp:variables|uPHP Variable Types and Limits]]
  
uphp/functions/isset.1489865826.txt.gz · Last modified: 2021/09/13 05:56 (external edit)