User Tools

Site Tools


uphp:functions:is_string

Differences

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

Link to this comparison view

uphp:functions:is_string [2017/04/06 12:46]
jeff
uphp:functions:is_string [2021/09/13 05:57]
Line 1: Line 1:
-======is_string====== 
- 
-<badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> 
- 
-Check if a variable is a <html><b><span style="color:green">string<span style="color:black"></b></html> 
- 
-====Description==== 
- 
-<well size="sm"> 
-<html> 
-<span style="font-size:125%;color:green">int 
-<span style="color:black"> 
-</html> 
-[[is_string]] ( 
-<html> 
-<span style="color:green">mixed 
-<span style="color:blue">$variable 
-<span style="color:black">) 
-</html> 
-</well> 
- 
-Check to see if a variable or value is of type <html><b><span style="color:green">string<span style="color:black"></b></html> 
- 
-====Parameter==== 
- 
-<html><b><span style="color:blue">$variable<span style="color:black"></b></html>:  Variable or expression to be evaluated 
- 
-====Return Value==== 
- 
-1 (true) if a <html><b><span style="color:green">string<span style="color:black"></b></html>, 0 (false) if not a string 
- 
-====Examples==== 
- 
-<code php> 
-<? 
-  $x=1.0; 
-  print(is_string($x)); // outputs 0, $x is a float 
-  $y="1.0"; 
-  print(is_string($y)); // outputs 1, $y is a string 
-  $z='' 
-  print(is_string($z)); // outputs 1, $z is an empty string 
-?> 
-</code> 
- 
-====Notes==== 
- 
-This function checks ONLY the type of the variable, not the data that it holds! 
- 
-====See Also==== 
- 
-[[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 a variable is a <html><b><span style="color:green">float<span style="color:black"></b></html> 
- 
-[[is_numeric()]] - Check if a value is numeric (<html><b><span style="color:green">int<span style="color:black"></b></html>, <html><b><span style="color:green">float<span style="color:black"></b></html> or numeric <html><b><span style="color:green">string<span style="color:black"></b></html>) 
- 
-[[is_array()]] - Check if a variable is an <html><b><span style="color:green">array<span style="color:black"></b></html> 
- 
-[[isset()]] - Check if a variable exists 
- 
-[[uphp:variables|uPHP Variable Types and Limits]] 
  
uphp/functions/is_string.txt · Last modified: 2021/09/13 05:57 (external edit)