//    dpm(drupal_get_filename('module','devel'));
//    sites/all/modules/contrib/dev/devel/devel.module

    //$abc = array('a','b','c');
    //$abc = 'abc';
    //dpm($efg);
    //Notice: Undefined variable: efg in qin_tt_init() (line 176 of D:\WWW\local\sites\all\modules\custom\directory_test\qin_tt.module).
    //空白没有其他的报错

//    $arr1 = array('a','b','c');
//    $arr2 = array('a'=>'a','b'=>'b','c'=>'c');
//    $arr3 = array('z'=>'a','x'=>'b','d'=>'c');
//ksort($arr1);
//ksort($arr2);
//ksort($arr3);
//    dpm($arr1);
//dpm($arr2);
//dpm($arr3);
//    //
//    ... (Array, 3 elements)
//
//    d (String, 1 characters ) c
//    x (String, 1 characters ) b
//    z (String, 1 characters ) a

//    $arr5 = array(6,'z'=>'a','x'=>'b','d'=>'c');
//    ksort($arr5);
//    dpm($arr5);
//
//        ... (Array, 4 elements)
//
//        d (String, 1 characters ) c
//        x (String, 1 characters ) b
//        z (String, 1 characters ) a
//        0 (Integer) 6
    //ksort的字母是abcd->数字比字母大且比较的是键值

//$arr = array('ABC'=>'abc');
//$arr1 = array('abc'=>'abc');
//
//    dpm($arr == $arr1); //0
//
//    $arr3 = array('ABC'=>'abc');
//    $arr4 = array('ABC'=>'abc');
//
//    dpm($arr3 == $arr4);//1
    //还是挺分大小写的key值,value值就更不用说了

//    $keys=array("a","b","c","d");
//    $a1=array_fill_keys($keys,"blue");
//    print_r($a1);
//    Array ( [a] => blue [b] => blue [c] => blue [d] => blue )

//    dpm('a\nb');
//    a\nb

//    $connection_info = Database::getConnectionInfo();
//    dpm($connection_info);
//      ... (Array, 1 element)
//
//      default (Array, 7 elements)
//          database (String, 5 characters ) local
//          username (String, 4 characters ) root
//          password (String, 4 characters ) root
//          host (String, 9 characters ) localhost
//          port (String, 0 characters )
//          driver (String, 5 characters ) mysql | (Callback) mysql();
//          prefix (Array, 1 element)

//    $files = db_query("SELECT * FROM {registry_file}")->fetchAllAssoc('filename', PDO::FETCH_ASSOC);
//    dpm($files);
//    //一个以filename为键的数组其中的值包含filename和hash

//    $contents = 'final class abc';
//    preg_match_all('/^\s*(?:abstract|final)?\s*(class|interface|trait)\s+([a-zA-Z0-9_]+)/m', $contents, $matches);
//    dpm($matches);
//
//      ... (Array, 3 elements)
//        0 (Array, 1 element)
//            0 (String, 15 characters ) final class abc
//        1 (Array, 1 element)
//            0 (String, 5 characters ) class
//        2 (Array, 1 element)
//            0 (String, 3 characters ) abc

//    foreach (file_scan_directory('includes', '/\.inc$/') as $filename => $file) {
//      $files["$filename"] = array('module' => '', 'weight' => 0);
//    }
//
//    dpm($files);
//    // /includes下共69个.inc文件

    //dpm(db_like('abc//d'));//abc//d
    //dpm(db_like('abc"d'));//abc"d
   // dpm(db_like("a'b"));//a'b
   // dpm(db_like("a%b"));//a\%b
    //dpm(db_like("a&b"));//a&b
    //\%_只对这个三个字母有效

//    $user = Database::getConnection('default', 'default')
//      ->select('users', 'r', array('target' => 'default'))
//      ->fields('r')
//      // Use LIKE here to make the query case-insensitive.
//      ->condition('r.name', '%'.db_like('ROOT').'%', 'LIKE')
//    //  ->condition('r.name', db_like('ROOT'), 'LIKE')
//      ->execute()
//      ->fetchAll();
//
//    dpm($user);
    //确实大小写忽略

  // dpm(db_like(db_like('a_b%c\d')));
    //a\\\_b\\\%c\\\\d
//处理了两次

//    dpm(str_replace("world","Shanghai","Helloxxxx!"));
//    //Helloxxxx!

  //  require_once DRUPAL_ROOT . '/ABC.php';
//    include_once DRUPAL_ROOT . '/ABC.php';

//    Warning: require_once(D:\WWW\local/ABC.php): failed to open stream: No such file or directory in qin_tt_init() (line 294 of D:\WWW\local\sites\all\modules\custom\directory_test\qin_tt.module).
//    Warning: include_once(D:\WWW\local/ABC.php): failed to open stream: No such file or directory in qin_tt_init() (line 295 of D:\WWW\local\sites\all\modules\custom\directory_test\qin_tt.module).
//    Warning: include_once(): Failed opening 'D:\WWW\local/ABC.php' for inclusion (include_path='.;C:\php\pear') in qin_tt_init() (line 295 of D:\WWW\local\sites\all\modules\custom\directory_test\qin_tt.module).

    //require once是必须要 不然就报错
    //include once是有就给 不然也没关系

   // dpm(__FILE__);
    //D:\WWW\local\sites\all\modules\custom\directory_test\qin_tt.module
    //dpm($_SERVER['SCRIPT_FILENAME']);
    //D:/WWW/local/index.php
   // dpm($_SERVER['SCRIPT_NAME']);
    ///local/index.php
    //看来只有__FILE__最实在路径最全

   // dpm(dirname(realpath(__FILE__)));
    //D:\WWW\local\sites\all\modules\custom\directory_test

    //dpm('5.1.59' > '5.0.26');
    //1
    //字符串也可以比较大小的

//    dpm(array_values('abc'));
//    //Warning: array_values() expects parameter 1 to be array, string given in qin_tt_init() (line 320 of D:\WWW\local\sites\all\modules\custom\directory_test\qin_tt.module).
//
//    foreach(array_values('abc') as $abc){
//      dpm($abc);
//    }
    //Warning: Invalid argument supplied for foreach() in qin_tt_init() (line 323 of D:\WWW\local\sites\all\modules\custom\directory_test\qin_tt.module).
//同样会报错

//    foreach(array('a'=>'b','c'=>'d') as $key => $data){
//      dpm($data);
//    }

    //require_once DRUPAL_ROOT . '/includes/database/database.inc';

//    $str = 'SELECT n.nid, n.title, n.created FROM {node} n WHERE n.uid = :uid ORDER BY n.created DESC';
//
//    $option = array(array(':uid' => 123));
//
//    $dsn = 'mysql:host=localhost;port=3306';
//    $user= 'root';
//    $p= 'root';
//
//    $op = array('host'=>'localhost','username'=>'root','password'=>'root');
//
//    //$conn = new DatabaseConnection_mysql($op);//
//
//
//
//  //  $conn = new DatabaseConnection($dsn,$user,$p);
//
//   // DatabaseConnection::expandArguments($str,$option);
//
//    $s = 'SELECT 1 FROM {blocked_ips} WHERE ip = :ip';
//    $o =  array(':ip'=>'127.0.0.1');
//    $res = expandArguments($s,$o);
//    dpm($s);
//    dpm($res);

//    foreach (array_filter(array(':ip'=>array(0=>'127.0.0.1')), 'is_array') as $key => $data) {
//      dpm('aaaaaaaaaaa');
//    }

//    dpm(array_filter(array(2,3,4,5),'test_odd'));
//
//        ... (Array, 2 elements)
//            2 (Integer) 4
//            3 (Integer) 5

//    dpm(array_filter(array(1,2,3,4,0,5,0)));
//
//        ... (Array, 5 elements)
//
//            0 (Integer) 1
//            1 (Integer) 2
//            2 (Integer) 3
//            3 (Integer) 4
//            5 (Integer) 5

//    $abc = 'qinqiu';
//    dpm(is_string($abc));

//    dpm(key(array(1,2)));
//    //0

//    $clone = clone((object)array('a'=>1,'b'=>2));
//    dpm($clone);
//      ... (Object) stdClass
//        a (Integer) 1
//        b (Integer) 2

//   $users =  db_select('users','u')
//      ->fields('u')
//    // ->condition('uid',1)
//      ->addExpression('count(*)','count')
//      ->execute();

//    $q = db_select('users', 'u')
//    ->fields('u');
////      ->condition('QueueID', $task['ID'])
////      ->condition('IsDone', 0);
//    $q->addExpression('count(*)','count');
//    //addexpression基本就是新增了一个field
//    $count = $q->execute()->fetchAssoc();
//    dpm($count);
//    //现在得出的结论是一个数组有18个元素
//    //没有addexpression的话就是17个元素

//    while($user = $users->fetch()){
//      dpm($user);
//    }

    //从fetch函数本来来说一次只能提取一个结果集currentrow
    //currentrow是怎么来的呢是reset($this->data)

  //  dpm($users);

//    $arr = array(1,2,3,4);
//    dpm(reset($arr));
//    //1

//    $arr = array(1,2,3,4);
//    dpm(key($arr));
//    //0

//    $res = db_query('select * from users')->fetchAll(PDO::FETCH_ASSOC);
//    dpm($res);
//
//    $dbms='mysql';
//    $dbName='local';
//    $user='root';
//    $pwd='root';
//    $host='localhost';
//    $dsn="$dbms:host=$host;dbname=$dbName";
//    try{
//      $pdo=new PDO($dsn,$user,$pwd);
//      $query = 'select * from users';
//      $statement = $pdo->prepare($query);
//
//      $data = $statement->fetchAll(PDO::FETCH_ASSOC);
//      dpm($data);
//
//    }catch(Exception $e){
//      echo $e->getMessage().'<br>';
//    }

//    define('ABC_QINQIU','abc_abc');
//    dpm(is_string(ABC_QINQIU));
//    //1

//    define('ABC_QINQIU',123);
//    dpm(is_int(ABC_QINQIU));
//    //1

    //$i = 1;
    //dpm('abc_'. $i++);
    //abc_1
    //dpm($i);
    //2

test 2017-1-5的更多相关文章

  1. CI Weekly #10 | 2017 DevOps 趋势预测

    2016 年的最后几个工作日,我们对 flow.ci Android & iOS 项目做了一些优化与修复: iOS 镜像 cocoapods 版本更新: fir iOS上传插件时间问题修复: ...

  2. 猖獗的假新闻:2017年1月1日起iOS的APP必须使用HTTPS

    一.假新闻如此猖獗 刚才一位老同事 打电话问:我们公司还是用的HTTP,马上就到2017年了,提交AppStore会被拒绝,怎么办? 公司里已经有很多人问过这个问题,回答一下: HTTP还是可以正常提 ...

  3. iOS的ATS配置 - 2017年前ATS规定的适配

    苹果规定 从2017年1月1日起,新提交的 app 不允许使用NSAllowsArbitraryLoads来绕过ATS(全称:App Transport Security)的限制. 以前为了能兼容ht ...

  4. 深入研究Visual studio 2017 RC新特性

    在[Xamarin+Prism开发详解三:Visual studio 2017 RC初体验]中分享了Visual studio 2017RC的大致情况,同时也发现大家对新的Visual Studio很 ...

  5. Xamarin+Prism开发详解三:Visual studio 2017 RC初体验

    Visual studio 2017 RC出来一段时间了,最近有时间就想安装试试,随带分享一下安装使用体验. 1,卸载visual studio 2015 虽然可以同时安装visual studio ...

  6. Microsoft Visual Studio 2017 for Mac Preview 下载+安装+案例Demo

    目录: 0. 前言 1. 在线安装器 2. 安装VS 3. HelloWorld 4. ASP.NET MVC 5. 软件下载 6. 结尾 0. 前言: 工作原因,上下班背着我的雷神,一个月瘦了10斤 ...

  7. Create an offline installation of Visual Studio 2017 RC

    Create an offline installation of Visual Studio 2017 RC ‎2016‎年‎12‎月‎7‎日                             ...

  8. .NET Core 2.0版本预计于2017年春季发布

    英文原文: NET Core 2.0 Planned for Spring 2017 微软项目经理 Immo Landwerth 公布了即将推出的 .NET Core 2.0 版本的细节,该版本预计于 ...

  9. 卡巴斯基2017激活教程_卡巴斯基2017用授权文件KEY激活的方法

    原创:天诺时空 更新时间:2016-11-09   2016年9月7日,卡巴斯基2017版全新上市,卡巴斯基依旧为大家奉上满足您所有需求的安全软件产品,为不同年龄层.不同人群给予全方位保护,同时延续卡 ...

  10. 2016总结&2017计划

    2016总结 总体而言,上半年比较勤快,下半年偷懒了.下半年仔细看了Barfoot的书<state estimation for robotics>,收获很大. 2017计划 目前打算写以 ...

随机推荐

  1. CentOS下搭建LAMP环境详解

    前言:在这里将介绍如何在CentOS下搭建LAMP环境(全部使用源码编译安装),用于web服务器开发. •LAMP: Linux + Apache + PHP + Mysql. •系统: CentOS ...

  2. [osx] android studio下修改avd的hosts文件

    1. 启动avd 安装/启动avd就不说啦,可以直接在android studio里面操作的 2. 进入adb目录 当然是打开终端来敲命令啦. cd /Users/birdylee/Library/A ...

  3. Win8+VMware12+CentOS7网络设置

    VMware提供了三种将虚拟网卡和物理网卡捆绑起来的方式,即桥接(Bridge)模式,网络地址转换(Network Address Transformation, NAT)模式和主机(Host Onl ...

  4. mybatis+MySQL--CRUD

    ①导入jar包: ②.配置config.xml: ③.entity: mapping: ④.DAO:   —————————————————————————————————— 目录结构: —————— ...

  5. C# ComBox 垂直滚动条

    用到Combox控件两个属性: 1 MaxDorpDownItems 显示条数 2 IntegralHeight 设置 为false 例如:显示最多20条,超过20条显示垂直滚动条 this.comb ...

  6. Good Bye 2015 D. New Year and Ancient Prophecy

    D. New Year and Ancient Prophecy time limit per test 2.5 seconds memory limit per test 512 megabytes ...

  7. 七牛整合php上传从微信下载接口下载下来的文件

    因为ios系统直接读取不了MP3格式的文件,所以从微信接口下载下来的MP3格式音频上传到七牛后要转码.   Sample code:   public function doMobileUploadT ...

  8. 写Python脚本语言时,“SyntaxError: Non-ASCII character '\xe6' in file”错误的处理

    如图是一段简单的文件操作代码,以为打开文件"test1221_1.py",若不存在此文件,则创建此文件.接下来并输出相关信息. 当少写了黄色方框圈起来的一行看似不经意的带有编码格式 ...

  9. python处理xml文件

    参考:https://docs.python.org/2/library/xml.etree.elementtree.html 例子: <?xml version="1.0" ...

  10. 为什么导入数据库要加入set names utf-8

    Repinted:http://blog.csdn.NET/class1/archive/2006/12/30/1469298.aspx 为了让你的网页能在更多的服务器上正常地显示,还是加上" ...