php查询ldap记录包括日期/时间戳字段

Is it possible to run a php query in ldap that gets the createTimestamp or modifyTimestamp fields? I have not had any luck.

The code below returns everything but those two fields.

if(@$info[$i]['mail']['0']) {
                $dateCreate = $info[$i]['createTimestamp ']['0'];
                $dateModify = $info[$i]['modifyTimestamp']['0'];
                $email =  $info[$i]['mail']['0'];
                $firstname =  $info[$i]['givenname']['0'];
                $lastname = $info[$i]['sn']['0'];
                $officeName = $info[$i]['physicaldeliveryofficename']['0'];
                echo $dateCreate.",".$dateModify.",".$firstname.",".$lastname.",".$email.",".$department.",".$title."---".$officeName."<br />";

Thanks in advance. I'll take any assistance including "look here" or "you are forgetting..." Peter T

In your ldap_serch-call you can add an array of retrieved attributes as 4th parameter. When you add a + as one of the parameters all the meta-attributes should be available as well.

$result = ldap_search($ldap, 'dc=example,dc=org', 'uid=doejane', ['cn', '+']);
var_dump(ldap_get_entries($ldap, $result));

And one of them (at least in my case) is the modifytimestamp