函数名:ldap_dn2ufn()
适用版本:PHP 4, PHP 5, PHP 7
用法:ldap_dn2ufn() 函数用于将给定的 DN(Distinguished Name)转换为用户友好的格式(User Friendly Name)。
语法:string ldap_dn2ufn ( string $dn )
参数:
- dn:需要转换的 DN 字符串。
返回值:返回转换后的用户友好的格式(User Friendly Name)字符串。
示例:
$dn = "cn=John Doe, ou=Users, dc=example, dc=com";
$ufn = ldap_dn2ufn($dn);
echo $ufn;
输出:
John Doe, Users, example.com
在上面的示例中,我们将给定的 DN(cn=John Doe, ou=Users, dc=example, dc=com)传递给 ldap_dn2ufn() 函数,它将返回用户友好的格式(User Friendly Name)字符串(John Doe, Users, example.com)并输出到屏幕上。