I have an action to check. If it has been set false in $Actions I need to do stuff.
$Actions['edit'] => true;
$Actions['delete'] => false;
$Actions['foo'] => true;
$Actions['bar'] => false;
$actionToCheck = 'delete';
Attempt 1:
$falseActions = '???';
if ( in_array( $actionToCheck, $falseActions ) ) {
//do stuff
}
Attempt 2:
if ( in_array( $actionToCheck, $Actions, false ) ) {
//do stuff
}
if ($Actions[$actionToCheck]) { // do something if true }if (!$Actions[$actionToCheck]) { // do something if false}falseis in the$Actionsarray, thenin_array()can do that, but it won't return the key value that isfalse.