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_OS, 0, 3)) === '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
Array ( [0] => . [1] => .. [2] => bar.php [3] => foo.txt [4] => somedir )
$dir = '/tmp';
$files1 = $files2 = 1);
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。