C language function:ldap_compare sample codes

Search sample code in the internet.It is the result.

TITLE : C API Reference
Similar to ldap_compare_ext(), the ldap_compare() function initiates an asynchronous compare operation and returns the message id of the operation initiated. As for ldap_compare_ext(), a subsequent call to ldap_result() can be used to obtain the result of the bind. In case of error, ldap_compare() returns -1, setting the session error parameters in the LDAP structure appropriately........

TITLE : C API Reference
A string attribute value to compare against, used by the ldap_compare() and ldap_compare_s() functions. Use ldap_compare_ext() or ldap_compare_ext_s() if you need to compare binary values........
TITLE : LDAP PHP Change Password Page GitHub
if(!ldap_compare($ldap, $userdn, 'objectClass', 'sambaSamAccount')){.......
TITLE : PHP: LDAP ֐ - Manual
$r=ldap_compare($ds, $dn, $attr, $value);.......
search Google