I have added the following code to a php script that adds users to an LDAP directory, now we need to log the changes. but when I run the code I get the error in the title.
$myFile = "newuser.log";
$fh = fopen($myFile, 'a') or die("can't open file");
$userInfo = $newUser['lastname'], $newUser['firstname'], $newUs$
fwrite($fh, $userInfo);
fclose($fh);
The culprit, as far as I can see (since I don’t see line numbers) is:
If you want to concatenate your array keys into one single variable, you have to use the “.” operator. So it would be:
Also, you might want to check the end of that line (
$newUs$) since that will end up in another syntax error (both$‘s and the missing;)