日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > javascript >内容正文

javascript

JSON 常量详情参考 (内含对中文不转义的参数)

發布時間:2025/3/15 javascript 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 JSON 常量详情参考 (内含对中文不转义的参数) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
JSON_ERROR_NONE (integer) 沒有錯誤發生。自 PHP 5.3.0 起生效。 JSON_ERROR_DEPTH (integer) 到達了最大堆棧深度。自 PHP 5.3.0 起生效。 JSON_ERROR_STATE_MISMATCH (integer) 出現了下溢(underflow)或者模式不匹配。自 PHP 5.3.0 起生效。 JSON_ERROR_CTRL_CHAR (integer) 控制字符錯誤,可能是編碼不對。自 PHP 5.3.0 起生效。 JSON_ERROR_SYNTAX (integer) 語法錯誤。 自 PHP 5.3.0 起生效。 JSON_ERROR_UTF8 (integer) 異常的 UTF-8 字符,也許是因為不正確的編碼。 自 PHP 5.3.3 起生效。 JSON_ERROR_RECURSION (integer) The object or array passed to json_encode() include recursive references and cannot be encoded. If the JSON_PARTIAL_OUTPUT_ON_ERROR option was given, NULL will be encoded in the place of the recursive reference. Available since PHP 5.5.0. JSON_ERROR_INF_OR_NAN (integer) The value passed to json_encode() includes either NAN or INF. If the JSON_PARTIAL_OUTPUT_ON_ERROR option was given, 0 will be encoded in the place of these special numbers. Available since PHP 5.5.0. JSON_ERROR_UNSUPPORTED_TYPE (integer) A value of an unsupported type was given to json_encode(), such as a resource. If the JSON_PARTIAL_OUTPUT_ON_ERROR option was given, NULL will be encoded in the place of the unsupported value. Available since PHP 5.5.0. JSON_ERROR_INVALID_PROPERTY_NAME (integer) A key starting with \u0000 character was in the string passed to json_decode() when decoding a JSON object into a PHP object. Available since PHP 7.0.0. JSON_ERROR_UTF16 (integer) Single unpaired UTF-16 surrogate in unicode escape contained in the JSON string passed to json_encode(). Available since PHP 7.0.0. 下面的常量可以和 json_decode() 的 form 選項結合使用。JSON_BIGINT_AS_STRING (integer) 將大數字編碼成原始字符原來的值。 自 PHP 5.4.0 起生效。 JSON_OBJECT_AS_ARRAY (integer) Decodes JSON objects as PHP array. This option can be added automatically by calling json_decode() with the second parameter equal to TRUE. Available since PHP 5.4.0. 下面的常量可以和 json_encode() 的 form 選項結合使用。JSON_HEX_TAG (integer) 所有的 < 和 > 轉換成 \u003C 和 \u003E。 自 PHP 5.3.0 起生效。 JSON_HEX_AMP (integer) 所有的 & 轉換成 \u0026。 自 PHP 5.3.0 起生效。 JSON_HEX_APOS (integer) 所有的 ' 轉換成 \u0027。 自 PHP 5.3.0 起生效。 JSON_HEX_QUOT (integer) 所有的 " 轉換成 \u0022。 自 PHP 5.3.0 起生效。 JSON_FORCE_OBJECT (integer) 使一個非關聯數組輸出一個類(Object)而非數組。 在數組為空而接受者需要一個類(Object)的時候尤其有用。 自 PHP 5.3.0 起生效。 JSON_NUMERIC_CHECK (integer) 將所有數字字符串編碼成數字(numbers)。 自 PHP 5.3.3 起生效。 JSON_PRETTY_PRINT (integer) 用空白字符格式化返回的數據。 自 PHP 5.4.0 起生效。 JSON_UNESCAPED_SLASHES (integer) 不要編碼 /。 自 PHP 5.4.0 起生效。 JSON_UNESCAPED_UNICODE (integer) 以字面編碼多字節 Unicode 字符(默認是編碼成 \uXXXX)。 自 PHP 5.4.0 起生效。 JSON_PARTIAL_OUTPUT_ON_ERROR (integer) Substitute some unencodable values instead of failing. Available since PHP 5.5.0. JSON_PRESERVE_ZERO_FRACTION (integer) Ensures that float values are always encoded as a float value. Available since PHP 5.6.6. JSON_UNESCAPED_LINE_TERMINATORS (integer) The line terminators are kept unescaped when JSON_UNESCAPED_UNICODE is supplied. It uses the same behaviour as it was before PHP 7.1 without this constant. Available since PHP 7.1.0.

?

轉載于:https://www.cnblogs.com/longlonglong/p/9466845.html

與50位技術專家面對面20年技術見證,附贈技術全景圖

總結

以上是生活随笔為你收集整理的JSON 常量详情参考 (内含对中文不转义的参数)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。