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 )

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

 

 

 
         
         
       


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM