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 )

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

 

 


原文地址:https://www.cnblogs.com/hehexu/p/8257091.html