I'm trying to include a php configuration file to my main, index.php file, but I faced two problems:
1) I don't know how to properly build an array and output a desirable "value" of the "key". For example:
function config() {
return $settings = array(
'url' => 'https://example.com',
'title' = > 'My dynamic website'
}
}
Is the above code correct? How do I echo the url, for example(or what is the best way to output it)?
2) I also thought of making a function to output the desirable value, but I doubt it's the right way. I tried this and it worked:
function myWebsiteURL() {
echo 'https://example.com'
}
And then I just called this function when needed.
What is the right way to make this kind of things, in terms of security and performance etc... I'm really just starting out, but I want to code in a right way from the beginning.