private static function serializeSection($sectionName, $data)
{
$output = [];
$output[] = "[{$sectionName}]";
$output = array_merge($output, self::serializeData($data));
// Add empty line after section. There could have been empty lines already generated from recursive
// calls so just add it if it's necessary.
if (end($output) !== "") {
$output[] = "";
}
return $output;
}