If you create the variable in config.php then it is loaded when you include the file in index.php like this:
config.php
<?php
$config = [
'key1' => 'value1',
'key2' => [
'subkey1' => 'value3'
],
'key3' => 'value4'
];
?>
index.php
include "config.php";
$value4 = $config['key3']; // 'value4'
made some assumptions because your question had very little information, hopefully this helps!
solved Write array formatted to file