diff --git a/src/Parser.php b/src/Parser.php index 02fb1eb..08f3a72 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -20,6 +20,11 @@ class Parser { "bool" => function ($input) { if ($input == null) return null; return !in_array($input, ["0", "false"]); + }, + "json" => function ($input) { + if ($input == null) return null; + $json = json_decode($input); + return is_array($json) ? $json : null; } ]; }