Can anyone explain why the following isn't working?
I want to write Blocked user
to log.txt
if $user
is in the array $blockedusers
$blockedusers = array("USER1", "USER2");
$user = "USER1";
foreach ($user as $blockedusers) {
$file = 'log.txt';
$current = file_get_contents($file);
$current .= 'Blocked user' . "
";
file_put_contents($file, $current);
}
Any ideas?