- array_key_exists: documentation ( source)
- print_r: documentation ( source)
<?php
$map = [
'center' => 1,
'left' => 2,
'right' => 3
];
if (array_key_exists($map[$align]) && isset($map[$align])) {
print_r("true");
} else {
print_r("false");
}