|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-08-04 02:15 UTC] zybersup at yahoo dot com
Description: ------------ Call the function parse_ini_file() with INI file that written in UTF-8 with BOM. Set process_sections to TRUE. The result is an array of all value correctly parsed, but no section processed. (That means the result is not multi-dimentional array.) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 06:00:01 2025 UTC |
Script to reproduce the bug ============================ <? $dir = dirname(__FILE__) . '/'; $ascii = parse_ini_file($dir . 'test_ascii.ini', true); $utf8bom = parse_ini_file($dir . 'test_utf8bom.ini', true); $utf8 = parse_ini_file($dir . 'test_utf8.ini', true); print_r($ascii); print_r($utf8bom); print_r($utf8); ?> Unsatisfied Result =================== (Don't worry about the value, just check the difference of array structure) Array ( [Section1] => Array ( [Aval] => ทดสอบ ทดสอบ (Test Test) [Bval] => ไทย ) [Section2] => Array ( [Cval] => Bar [Dval] => Foo ) ) Array ( [Aval] => เธ?เธ?เธชเธญเธ� เธ?เธ?เธชเธญเธ� (Test Test) [Bval] => เน�เธ?เธข [Section2] => Array ( [Cval] => Bar [Dval] => Foo ) ) Array ( [Section1] => Array ( [Aval] => เธ?เธ?เธชเธญเธ� เธ?เธ?เธชเธญเธ� (Test Test) [Bval] => เน�เธ?เธข ) [Section2] => Array ( [Cval] => Bar [Dval] => Foo ) ) Try testing a demo at http://www.theguru.co.th/zybersup/test_parse_ini.php (May not keep there more than 2 months)