由于json只接受utf-8编码的字符,所以json_encode()的参数必须是utf-8编码,否则会得到空字符或者null。
查看答案
由于javascript不支持关联数组,所以json_encode()只将索引数组(indexed array)转为数组格式,而将关联数组(associative array)转为对象格式。
A. 对
B. 错
json只能用来表示对象(object)和数组(array),如果对一个字符串或数值使用json_decode(),将会返回null。
A. 对
B. 错
PHP的哪个函数用于将json文本转换为相应的PHP数据结构。
A. json_decode()
B. json_encode()
C. strtostr
PHP的哪个函数主要用来将数组和对象,转换为json格式。
A. json_decode()
B. json_encode()
C. strtostr