Using the PHP Function LDAP_Parse_Result()
PHP is a general-purpose programming language with features that draw from C, Java and Perl. It is usually loaded with Web server applications such as Apache but can also be used as a standalone application. It is available on a vide range of platforms including UNIX, Windows, NetWare and OS/2. Its syntax is easy to learn and is well documented. The language is well suited for writing Web pages and applications, but its real value is in the vast choice of libraries and extensions that are available to support sophisticated features.
A good example of this is the Zend_Ldap library which provides methods for manipulating the directory and the contents of the LDAP tree. For instance, you can sort a set of attribute values, copy and move entries and subtrees and even import and export LDAP records in a variety of formats.
Another useful function is the ldap_parse_result() function, which takes an LDAP
A key feature of this function is that it supports type declaration for the return parameter. This allows you to tell PHP what data type the return value must be and it will raise a fatal error if a function returns a value that is not of the correct type.