bindtextdomain

(PHP 4, PHP 5, PHP 7, PHP 8)

bindtextdomainドメインのパスを取得/設定する

説明

bindtextdomain ( string $domain , string|null $directory ) : string|false

bindtextdomain() 関数は、ドメインへのパスを取得/設定します。

パラメータ

domain

ドメイン。

directory

ディレクトリのパス。 null を指定すると、現在設定されているディレクトリが返されます。

返り値

現在設定されているドメインへのフルパスを返します。 失敗した場合に false を返します

変更履歴

バージョン 説明
8.0.3 directory は、nullable になりました。 これより前のバージョンでは、現在設定されているディレクトリを取得できませんでした。

例1 bindtextdomain() の例

<?php

$domain 
'myapp';
echo 
bindtextdomain($domain'/usr/share/myapp/locale');

?>

上の例の出力は以下となります。

/usr/share/myapp/locale

注意

注意:

bindtextdomain() 関数の情報はプロセス単位で管理されます。 スレッドではありません。