See the comment in my code above. I don’t know if you should be setting the value to ‘1’ or 1 or true, it could make a difference. any non empty value will result in true in a statement like
if ($value) {
// do something
}
even a value of ‘0’ will return true because it is a non empty string.