Welcome Guest, Not a member yet? Register   Sign In
Array in .env file
#1

I was hoping from the docs here: Treating Environment Variables as Arrays that I could access something in the .env file that used dot syntax as an array but it doesn't seem to work.[url=https://codeigniter4.github.io/userguide/general/configuration.html#treating-environment-variables-as-arrays][/url]
Here is an example, after copying the env file to .env and uncommenting the database.default section:

PHP Code:
$database getenv('database');
var_dump($database); 

$database just contains boolean false.

Is it possible to access everything prefixed with e.g. 'database' as an array?
Thanks.
Reply


Messages In This Thread
Array in .env file - by rich8374 - 01-03-2020, 04:18 AM
RE: Array in .env file - by InsiteFX - 01-03-2020, 09:22 AM
RE: Array in .env file - by rich8374 - 01-03-2020, 10:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB