#31151 [Com]: parse_ini_file() can't handle newline

From: Date: Mon, 27 Dec 2004 12:41:42 +0000
Subject: #31151 [Com]: parse_ini_file() can't handle newline
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-71109@lists.php.net to get a copy of this message
 ID:               31151
 Comment by:       johanaworld at hotmail dot com
 Reported By:      johansworld at hotmail dot com
 Status:           Open
 Bug Type:         Feature/Change Request
 Operating System: *
 PHP Version:      4CVS-2004-12-17 (works in 5!)
 New Comment:

Even if not described, it works in PHP 5.x


Previous Comments:
------------------------------------------------------------------------

[2004-12-18 03:21:15] 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-17 13:08:09] 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
)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=31151&edit=1


Thread (4 messages)

« previous php.bugs (#71109) next »