Some background is needed. I am trying to retrieve the allowed logon hours for users from AD using the PHP function ldap_get_entries(). The data is stored in AD as a binary string (7 days * 24 hours = 168 bits needed, 168/8=21 bytes of data).
I am reading the data as a string
PHP Code:
$hours=$result_array[$row]["logonhours"][0]) 
$result_array is the variable that stores the query result, $row is the index in the array
Everything is fine as long as none of these returned bytes is 0. However, when a 0-byte is encountered, PHP considers that to be the end of the string and therefore truncates it as in this example:
PHP Code:
$data="abc".chr(0)."def";
print 
$data;
//outputs "abc" 
I need a suggestion of how to read and process the data (just need to be able to read the value of each byte) - or if someone already has a working example...