1
I am a beginner in php and I have a problem, I have a config.php file this way:
<?php
$config['dbHostname'] = 'localhost';
$config['dbUser'] = 'teste';
$config['dbPassword'] = 'passteste';
But I have a class with connection functions and database manipulation that would use these variables from config.php
however I could not access them in any way, please someone could help me?
Personal I’m sorry but the intention is to have a file only with settings, then in another class I will make the connection and data handling, not make the connection in the same php as the settings
– G.Foratini
The example is you have a really separate file, it is not logical to do in the same file and then use such file (with include or require) to have several files that will use database connection ... But, your question was not how to read such file with the variable Array $config ?
– user6026