php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #31151 parse_ini_file() can't handle newline
Submitted: 2004-12-17 13:08 UTC Modified: 2004-12-28 15:53 UTC
From: johansworld at hotmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4CVS-2004-12-17 (works in 5!) OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: johansworld at hotmail dot com
New email:
PHP Version: OS:

 

 [2004-12-17 13:08 UTC] johansworld at hotmail dot com
Description:
------------
parse_ini_file() can't handle newline

file.txt
----------------------------------
TEST="Line 1
Line 2
Line 3"
----------------------------------

parse_ini_file() only retrieves "Line 1" as a value for TEST.

Seems to be fixed in PHP 5.x ....

Reproduce code:
---------------
<?php
$file="file.txt";
$ini_array = parse_ini_file($file);
echo "<pre>";
print_r($ini_array);
echo "</pre>";
?>

Expected result:
----------------
Array 
( 
    [TEST] => Line 1
Line 2
Line 3
)

Actual result:
--------------
Array 
( 
    [TEST] => Line 1
)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-18 03:21 UTC] derick@php.net
This does not work, but it is not a bug. Nowhere in the documentation is this described to be working.
 [2004-12-27 13:41 UTC] johanaworld at hotmail dot com
Even if not described, it works in PHP 5.x
 [2004-12-27 14:58 UTC] derick@php.net
Marking this as a doc problem, as we're not adding new features to PHP 4.
 [2004-12-28 15:53 UTC] didou@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:11 UTC] phpdocbot@php.net
Automatic comment on behalf of didou
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=b8d5634e2e07c2cb49c880cf167cc9d3903d0b34
Log: fix #31151: parse_ini_file() can't handle newline with PHP4
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 18:01:33 2025 UTC