title: PHP: Getting variables form config.cfg with given structure
body: <p>it's probably a silly question for a pro, but even after hours of googleing I could not find a solution:</p>
  
  <p>I have a shared config.cfg with the following structure (so I can't do anything about the structure):</p>
  
  <pre><code>[config]
  fileExtensions="JPEG|JPG|jpg|jpeg|png|gif"
  contentFolder="Gallery"
  
  [images]
  maxSize=1900
  jpegQuality=85
  
  [thumbnails]
  jpegQuality=80
  blurredImageQuality=3
  </code></pre>
  
  <p>I managed to get the config.cfg into my php script and can call some variable, for example 'maxSize'. Now comes the but:</p>
  
  <p>My current solution just loads the config.cfg as a simple array:</p>
  
  <pre><code>Array ( [fileExtensions] =&gt; JPEG|JPG|jpg|jpeg|png|gif [contentFolder] =&gt; Gallery [sortOrder] =&gt; asc [titleDescSeparator] =&gt; $$ [albumCoverDetector] =&gt; @@@@@ [ignoreDetector] =&gt; _hidden [maxSize] =&gt; 1900 [jpegQuality] =&gt; 80 [blurredImageQuality] =&gt; 3 [allowedSizeValues] =&gt; 50|100|225|150|200|300|auto [allowOrigins] =&gt; * )
  </code></pre>
  
  <p>But to get a variable which is twice in the config.cfg, I need to load the config-file including the structure (with array and sub-arrays). Anybody has an idea how to do this? Heres my current code:</p>
  
  <pre><code>&lt;?php
  $config_values = parse_ini_file('./nano_photos_provider2.cfg');
  print_r($config_values); //call whole array
  echo $config_values[maxSize]; //call single variable
  ?&gt;
  </code></pre>
  
  <p>Any help is highly appreciated!</p>