Alternar alternativo com PHP
<?phpfunction alternate_switch($condition, $cases){ return $cases[$condition]();}$siteStatus = ‘offline’; // Probably gotten from config or whatever!!alternate_switch($siteStatus, [ ‘offline’ => function () { echo ‘Site is offline’; }, ‘online’ => function () { …
Continuar lendo