User Tools

Site Tools


syntax:functions:isjson

Differences

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

Link to this comparison view

syntax:functions:isjson [2020/11/25 17:56] – created dmitrysyntax:functions:isjson [2021/09/18 19:59] (current) craigt
Line 1: Line 1:
-===== IsJson(text) =====+======IsJSON(text) =====
 +Category:  Web function
  
-Returns TRUE if the argument can be parsed as a JSON object or JSON array. Otherwise returns FALSE.+\\  
 +=====Description===== 
 +This function returns TRUE if the argument can be parsed as a JSON object or JSON array. Otherwise, it returns FALSE.
  
- Example   Result  +\\  
-isjson("{}"  TRUE  | +=====Arguments===== 
-| isjson("JSON" |  FALSE  | +^Argument^Type^Description
-| isjson("a:{b:1}" |  FALSE  | +|text  |Text  |The string being tested as JSON or JSON object .  |
-| isjson("{a:{b:1}}" |  TRUE  | +
-| isjson('1,"a"' |  FALSE  | +
-| isjson('[1,"a"]' |  TRUE  |+
  
-=== See also === +**Return value type:** Boolean (TRUE/FALSE). 
-  * [[syntax:functions:isemail]] + 
-  * [[syntax:functions:isxml]]+\\  
 +=====Examples===== 
 + 
 +  isjson( '{}' )  //Returns TRUE 
 + 
 +  isjson( 'JSON' )  //Returns FALSE 
 + 
 +  isjson( 'a:{b:1}' )  //Returns FALSE 
 + 
 +  isjson( '{a:{b:1}}' )  //Returns TRUE 
 + 
 +  isjson( '1,"a"' )  //Returns FALSE 
 + 
 +  isjson( '[1,"a"]' )  //Returns TRUE 
 + 
 +\\  
 +=====See also===== 
 +  * [[syntax:functions:isemail|IsEmail(email_addr)]] 
 +  * [[syntax:functions:isxml|IsXML(text)]]
syntax/functions/isjson.txt · Last modified: 2021/09/18 19:59 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki