PHP – 如何獲取或設定域的路徑?
PHP 中的 bindtextdomain() 函式用於設定或獲取域的路徑。
語法
string bindtextdomain($str_domain, $str_directory)
引數
bindtextdomain() 接受兩個引數——
$str_domain——這是域。
$str_directory——這是目錄路徑。如果目錄路徑為 NULL,則它將返回當前設定的目錄。
返回值
bindtextdomain() 返回當前設定的域的完整指定路徑名。在失敗時,它將返回 False。
示例
<?php // domain of the app $str_domain = 'xampp'; // It will return the domain path echo bindtextdomain($str_domain,'C:\xampp\htdocs'); ?>
輸出
C:\xampp\htdocs
廣告