When a variable on the console is set
export VARIABLE=VALUE;
You can get it from PHP Command line (CLI) using
getenv(‘VARIABLE’)
Example
#script.php
<?php
var_dump(getenv('VAR'));
?>
From command line
php -f script.php //bool(false) export VAR=a;Â php -f script.php //string(1) "a"
RSS Feed
Twitter
Posted in 