bindtextdomain

(PHP 3 >= 3.0.7, PHP 4, PHP 5)

bindtextdomain -- Sets the path for a domain

Description

string bindtextdomain ( string domain, string directory )

The bindtextdomain() function sets the path for a domain. It returns the full pathname for the domain currently being set.

例子 1. bindtextdomain() example

<?php

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

?>

This will output:

/usr/share/myapp/locale


add a note add a note User Contributed Notes
Robert Beaudry
13-Feb-2006 06:19
To re-enforce Andreas' comment, I spent a few hours attempting to get phpldapadmin to work ... without success. I tracked it down to a "bindtextdomain" call that didn't return. Having found Andreas's note above, I simply added the php_gettext extension and everything now works!

Thanks Andreas.
Andreas Koepke: php at andreas dot id dot au
04-May-2004 12:19
This function requires the gettext extension to be added or compiled into PHP.

This is not mentioned anywhere above and had me stumped for a while, I only discovered this by reading the bug reports.