In what scenarios would using an INI file for storing access statistics be advantageous over using a database in PHP applications?

Using an INI file for storing access statistics in PHP applications may be advantageous when the data is relatively simple and does not require complex querying or relationships. INI files are easy to read and write, making them suitable for storing configuration settings or basic data like access statistics. However, for more complex data structures or frequent updates, using a database would be a more suitable choice.

// Read access statistics from an INI file
$accessStats = parse_ini_file('access_stats.ini');

// Update access count
$accessStats['total_visits']++;

// Write updated statistics back to the INI file
$iniString = '';
foreach ($accessStats as $key => $value) {
    $iniString .= "$key = $value\n";
}
file_put_contents('access_stats.ini', $iniString);