Why would one do this.
for ($i = 0; $i < $len; $i++) {
$unicodepassword .= "{$passwd{$i}}\000";
}
Context: This is a password set when creating or modifying a user in Active directory. We are rewriting some ancient code and nothing works without this. Making changes in our LDAP does not require this kind of "encoding".
Also the result of this exercise is called "unicodepassword", seems strange to me.