美文网首页
2018-01-08 技术笔记

2018-01-08 技术笔记

作者: zhaohw810 | 来源:发表于2018-01-08 09:48 被阅读0次

    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;
    

    相关文章

      网友评论

          本文标题:2018-01-08 技术笔记

          本文链接:https://www.haomeiwen.com/subject/bhvvnxtx.html