if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) {
echo "Using LDAPv3"."<br />;";
} else {
echo "Failed to set protocol version to 3"."<br />;";
echo "Using LDAPv3"."<br />;";
} else {
echo "Failed to set protocol version to 3"."<br />;";
}