I'm pretty sure it's the "base dn" that allows you to limit the search to sub domains.
i.e.:
$basedn = "ou=marketing,o=northpole";
$rh = ldap_search($link,$basedn,$filter);
will only search in the base dn of ou=marketing,o=northpole, even if the basedn of the master ldap database is o=northpole.