Skip to content

Instantly share code, notes, and snippets.

@mishterk
Last active July 1, 2020 11:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mishterk/0bf801cd984eb5bc36384f9d611e34de to your computer and use it in GitHub Desktop.
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/
<?php
$config = include 'config.php';
echo $config['some']; // 'config'
<?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