Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
たとえば、私はそうしようとしました:
parse_ini_string(' abc[] = ');
ただし、要素abcは空ではなく、空の文字列が1つあります。
空の配列を INI ファイルに直接格納することはできません。INI 形式は十分に表現力がありません。上記の構文は配列のプッシュを記述しているため、空の要素を配列にプッシュします。
回避策は、醜いですが、次のようなものです。
$parsed = parse_ini_file('file.ini'); foreach ($parsed as $k => &$v) { if ($v === array('')) { $v = array(); } }