How can I access database, host, password and username values if they are embedded in an array of another file? In Sample.php I'm trying to reuse the mentioned values from Configuration.php. How to do so? Unfortunately I can't change Configuration.php.
Configuration.php
<?php
return [
...
'DB' => [
'database' => 'mydatabase',
'host' => 'myhost',
'password' => 'mypassword',
'port' => '',
'username' => 'myusername',
],
...
];
Sample.php
<?php
require('../Configuration.php');
$mysqli = new MySQLi($server,$user,$password,$database);
...
$arr = include('../Configuration.php');returnmeans you should store the result in a variable like$config = include('../Configuration.php');and then you can read$config['DB']['host']