json_encode 函数
json_encode()
PHP的json_encode函数在转化数组的时候有两个规则:
$a = array('a','b','c'); //Non associatvie
$b = array('foo'=>'bar','baz'=>'long'); //associative
echo json_encode($a); // ["a","b","c"]
echo json_encode($b); // {"foo":"bar","baz":"long"}
echo json_encode($a,JSON_FORCE_OBJECT) // {"1":"a","2":"b","3":"c"}
mysql 常用操作命令
CREATE DATABASE name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON name.* TO "username"@"%" IDENTIFIED BY '123456';
SHOW CREATE TABEL tablename;