<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # 公共函數 CodeIgniter 定義了一些全局的函數,你可以在任何地方使用它們,并且不需要加載任何 類庫或輔助函數。 >[info] ### is_php($version) 參數: * **$version**?(string) -- Version number 返回: TRUE if the running PHP version is at least the one specified or FALSE if not 返回類型: bool 判斷當前運行的 PHP 版本是否高于或等于你提供的版本號。 例如: ~~~ if (is_php('5.3')) { $str = quoted_printable_encode($str); } ~~~ 如果當前運行的 PHP 版本等于或高于提供的版本號,該函數返回布爾值 TRUE ,反之則返回 FALSE 。 >[info] ### is_really_writable($file) 參數: * **$file**?(string) -- File path 返回: TRUE if the path is writable, FALSE if not 返回類型: bool 在 Windows 服務器上只有當文件標志了只讀屬性時,PHP 的?is_writable()?函數才返回 FALSE , 其他情況都是返回 TRUE ,即使文件不是真的可寫也返回 TRUE 。 這個函數首先嘗試寫入該文件,以此來判斷該文件是不是真的可寫。通常只在?is_writable()?函數 返回的結果不準確的平臺下才推薦使用該函數。 例如: ~~~ if (is_really_writable('file.txt')) { echo "I could write to this if I wanted to"; } else { echo "File is not writable"; } ~~~ 注解 更多信息,參看?[PHP bug #54709](https://bugs.php.net/bug.php?id=54709)?。 >[info] ### config_item($key) 參數: * **$key**?(string) -- Config item key 返回: Configuration key value or NULL if not found 返回類型: mixed 訪問配置信息最好的方式是使用?[配置類](http://codeigniter.org.cn/user_guide/libraries/config.html)?,但是,你也可以通過?config_item()?函數來訪問單個配置項,更多信息,參看?[配置類](http://codeigniter.org.cn/user_guide/libraries/config.html) >[info] ### set_status_header($code[,?$text = '']) 參數: * **$code**?(int) -- HTTP Reponse status code * **$text**?(string) -- A custom message to set with the status code 返回類型: void 用于手動設置服務器的 HTTP 狀態碼,譬如: ~~~ set_status_header(401); // Sets the header as: Unauthorized ~~~ [查看這里](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html)?有一份狀態碼的完整清單。 >[info] ### remove_invisible_characters($str[,?$url_encoded = TRUE]) 參數: * **$str**?(string) -- Input string * **$url_encoded**?(bool) -- Whether to remove URL-encoded characters as well 返回: Sanitized string 返回類型: string 這個函數防止在 ASCII 字符串中插入空字符,例如:Java\0script 。 舉例: ~~~ remove_invisible_characters('Java\\0script'); // Returns: 'Javascript' ~~~ >[info] ### html_escape($var) 參數: * **$var**?(mixed) -- Variable to escape (string or array) 返回: HTML escaped string(s) 返回類型: mixed 這個函數類似于 PHP 原生的?htmlspecialchars()?函數,只是它除了可以接受字符串參數外,還可以接受數組參數。 它在防止 XSS 攻擊時很有用。 >[info] ### get_mimes() 返回: An associative array of file types 返回類型: array 這個函數返回?application/config/mimes.php?文件中定義的 MIME 數組的?**引用**?。 >[info] ### is_https() 返回: TRUE if currently using HTTP-over-SSL, FALSE if not 返回類型: bool 該函數在使用 HTTPS 安全連接時返回 TRUE ,沒有使用 HTTPS(包括非 HTTP 的請求)則返回 FALSE 。 >[info] ### is_cli() 返回: TRUE if currently running under CLI, FALSE otherwise 返回類型: bool 當程序在命令行下運行時返回 TRUE ,反之返回 FALSE 。 > 注解 > 該函數會檢查?PHP_SAPI?的值是否是 'cli' ,或者是否定義了?STDIN?常量。 >[info] ### function_usable($function_name) 參數: * **$function_name**?(string) -- Function name 返回: TRUE if the function can be used, FALSE if not 返回類型: bool 檢查一個函數是否可用,可用返回 TRUE ,否則返回 FALSE 。 該函數直接調用?function_exists()?函數,并檢查當前是否加載了?Suhosin 擴展 ?,如果加載了 Suhosin ,檢查函數有沒有被它禁用。 這個函數在你需要檢查某些函數的可用性時非常有用,例如?eval()?和?exec()?函數是非常危險的,可能會由于服務器的安全策略被禁用。 > 注解 > 之所以引入這個函數,是由于 Suhosin 的某個 bug 可能會終止腳本的執行, 雖然這個 bug 已經被修復了(版本 0.9.34),但可惜的是還沒發布。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看