Skip to content

Instantly share code, notes, and snippets.

@mihow
Created Jan 29, 2020
Embed
What would you like to do?
Cast env var to boolean with default value in PHP
# https://craftcms.stackexchange.com/questions/13584/devmode-phpdotenv-variable-ignored
'devMode' => filter_var(getenv('DEV_MODE') ?: false, FILTER_VALIDATE_BOOLEAN),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment