PHP。 如果用函数parse_ini_string()解析它们,如何在ini文件中存储空数组?

For example I tried so:

parse_ini_string('
    abc[] =
');

but the element abc is not empty, there is 1 empty string in it

You can't store empty arrays in an INI file directly. The INI format is not expressive enough - the syntax above describes an array push, and as such it pushes an empty element onto the array.

A workaround, albeit ugly, is something like this:

$parsed = parse_ini_file('file.ini');

foreach ($parsed as $k => &$v) {
  if ($v === array('')) {
    $v = array();
  }
}