Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /www/wwwroot/sengshao.com/zb_system/function/c_system_event.php on line 2059

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /www/wwwroot/sengshao.com/zb_system/function/c_system_event.php on line 2060

Deprecated: Return type of Config::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/wwwroot/sengshao.com/zb_system/function/lib/config.php on line 26

Deprecated: Return type of Config::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/wwwroot/sengshao.com/zb_system/function/lib/config.php on line 36

Deprecated: Return type of Config::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/wwwroot/sengshao.com/zb_system/function/lib/config.php on line 31

Deprecated: Return type of Config::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/wwwroot/sengshao.com/zb_system/function/lib/config.php on line 41

Deprecated: Return type of Config::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/wwwroot/sengshao.com/zb_system/function/lib/config.php on line 17

Deprecated: Constant E_STRICT is deprecated in /www/wwwroot/sengshao.com/zb_system/function/c_system_debug.php on line 80

Deprecated: Constant E_STRICT is deprecated in /www/wwwroot/sengshao.com/zb_system/function/c_system_debug.php on line 80
json的3个格式 - 僧少博客
当前位置:首页 > 编程 > 正文

json的3个格式

  1. 基本形式

        比如字符串  整数 小数    

    2. 对象格式

       { 

    "name": "xiongwei",

    "age": "18"

}

    对应js中的对象格式,   python 中的字典模式


3. 数组格式

    ["AAA", "BBB", "CCC"]

对应js中的数组, python 中的列表   可以嵌套格式2


注意点:   json格式是字符串格式   必须用双引号


python序列化

import json

res = json.dumps(xx)

python反序列化

res = json.loads(xx)


常用格式就是 格式3 嵌套 格式2


[

    {"name", "xiongwei"},

    {"name", "xiaoming"}

]



发表评论


Deprecated: Constant E_STRICT is deprecated in /www/wwwroot/sengshao.com/zb_system/function/c_system_debug.php on line 80