Last active
July 1, 2020 11:18
-
-
Save mishterk/0bf801cd984eb5bc36384f9d611e34de to your computer and use it in GitHub Desktop.
An example illustrating PHP's ability to return data from included files. For more info, see https://philkurth.com.au/tips/included-files-can-return-values-which-is-a-great-way-to-manage-app-configurations/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$config = include 'config.php'; | |
echo $config['some']; // 'config' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
'some' => 'config', | |
'data' => 'could', | |
'go' => 'here' | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment