Hi all.

Is it possible to explode an array and have it exclude a certain string. I currently have an array that is an ldapsearch that returns sub-accounts of a parent account. These accounts are then displayed so customer can either change the passwd or delete them. Thing is ldapsearch returns everymatch which includes the parent account, which is already listed on the page as the parent account. I would like to eliminate the second listing of the parent account where the sub-accounts are listed.

This is where the array is collected:

$search = ldap_search($connection,"dc=isp,dc=com", "ispParentAcct=$sessUsername");

                    $entries = ldap_get_entries($connection, $search);
                        $num = $entries["count"];

if ($num) {
$sessSubAccounts = "";
$i = 0;
while ($i < $num) {
$sessSubAccounts .= $entries[$i]["uid"][0] . "|";
$i++;
}
}
One thing I would like to point out is that I did not have this problem before, but when I updated to a new version of openldap the following ldapsearch would no longer return the subaccounts:


$search = ldap_search($connection,"dc=isp,dc=com", "homeDirectory=/home/$sessUsername/*");

Any idea why that may be?

This is where the array is exploded:

<?
       $i = 0;

if ($sessSubAccounts) {

$accounts = explode("|", $sessSubAccounts);

                    while ($i < count($accounts) - 1)
  ?>

TIA
----------------------------------------------------
Bobby R. Cox
Linux Systems Administrator
Project Mutual Telephone
[EMAIL PROTECTED]
208.434.7185
----------------------------------------------------
Fix the problem,  not the blame.   <><
----------------------------------------------------

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to