コード例 #1
0
ファイル: Json.class.php プロジェクト: kostyll/ekode
 static function phpJsonEncode($val)
 {
     $json = json_encode(haxe_Json::convertBeforeEncode($val));
     if ($json === false) {
         haxe_Json_0($json, $val);
     } else {
         return $json;
     }
 }
コード例 #2
0
ファイル: Json.class.php プロジェクト: axelhuizinga/gem
 static function phpJsonEncode($val, $replacer = null, $space = null)
 {
     if (null !== $replacer || null !== $space) {
         return haxe_format_JsonPrinter::hprint($val, $replacer, $space);
     }
     $json = json_encode(haxe_Json::convertBeforeEncode($val));
     if ($json === false) {
         throw new HException("invalid json");
     } else {
         return $json;
     }
 }