zoukankan      html  css  js  c++  java
  • php_os 检查php运行环境

    if(strtolower(PHP_OS)=='linux'){
    $tests['os']['state']="good";
    $tests['os']['message']='OS Detected: '.PHP_OS;
    }
    。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
    <?php
    // Example loading an extension based on OS
    if (!extension_loaded('sqlite')) {        判断sqlite扩张是否加载
        if (strtoupper(substr(PHP_OS03)) === 'WIN') {
            dl('php_sqlite.dll');       在程序运行时,加载对应的win扩展模块 
        } else {
            dl('sqlite.so');          在程序运行时,加载对应的linux扩展模块 
        }
    }

    // Or, the PHP_SHLIB_SUFFIX constant is available as of PHP 4.3.0
    if (!extension_loaded('sqlite')) {
        $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' '';
        dl($prefix 'sqlite.' PHP_SHLIB_SUFFIX);
    }
    ?>
    、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、 

    scandir列出指定路径中的文件和目录

    说明
    array scandir ( string $directory [, int $sorting_order [, resource $context ]] )

    返回一个 array,包含有 directory 中的文件和目录。

    <?php
    $dir    '/tmp';
    $files1 $files2 1);

    Array ( [0] => . [1] => .. [2] => bar.php [3] => foo.txt [4] => somedir )

    。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

     

     

    
    
  • 相关阅读:
    《作业二》总结
    《作业一》总结
    团队项目-需求分析报告
    团队项目-选题报告
    第一次结对编程作业
    第一次个人编程作业
    第一次博客作业
    第12组 团队项目-需求分析报告
    团队项目-选题报告
    第二次结对编程作业
  • 原文地址:https://www.cnblogs.com/hehexu/p/8257091.html
Copyright © 2011-2022 走看看