How can I make this into a boolean?
I tried this :
array('FALSE' => 'No', 'TRUE' => 'Yes')
I want the TRUE/FALSE to be treated as a boolean and not a string. How to do this?
When you put values in quotes, they are treated as strings. Simply use the true and false boolean keywords, eg
array(
false => 'No',
true => 'Yes'
)
Be mindful that PHP will auto-cast true to 1 and false to 0 in this case because
The (array) key can either be an integer or a string
This won't stop you being able to use $array[true] or $array[false] though.