I want to format the output of PHP array into HTML, that will align properly. And how will remove the array and other stuffs? Also, I want to group it by "ou". Ou have 4 or more categories.
The output will be like this with html table
sn dn mail
user cn=user,ou=web service,dc=domain,dc=com [email protected]
Or like this
sn dn mail ou
user cn=user,ou=web service,dc=domain,dc=com [email protected] web service
Please help me. Thank you
Here's the output without html
array(1410) { ["count"]=> int(1409) [0]=> array(4) { ["sn"]=> array(2) { ["count"]=> int(1) [0]=> string(11) "user" } [0]=> string(2) "sn" ["count"]=> int(1) ["dn"]=> string(56) "cn=user,ou=web service,dc=domain,dc=com" } [1]=>.....
Here's the PHP array
$dn = 'dc=domain,dc=com';
$filter = "(|(sn=$person*)(fullname=$person*))";
$ldaparray = array ("ou", "sn", "fullname", "mail");
$sr=ldap_search($ldapconn, $dn, $filter, $ldaparray);
$info = ldap_get_entries($ldapconn, $sr);
var_dump($info);
Output using print_r
Array
(
[count] => 1409
[0] => Array
(
[sn] => Array
(
[count] => 1
[0] => user
)
[0] => sn
[count] => 1
[dn] => cn=username,ou=webservice,dc=domain,dc=com
)
[1] => Array
(
[sn] => Array
(
[count] => 1
[0] => user
)
[0] => sn
[mail] => Array
(
[count] => 1
[0] => [email protected]
)
[1] => mail
[count] => 2
[dn] => uid=userid,ou=webser,dc=doamin,dc=com
)