#29014 [Bgs]: strings without \r\n

From: Date: Mon, 05 Jul 2004 09:55:38 +0000
Subject: #29014 [Bgs]: strings without \r\n
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-61692@lists.php.net to get a copy of this message
ID: 29014 User updated by: zxc at zmail dot ru Reported By: zxc at zmail dot ru Status: Bogus Bug Type: PCRE related Operating System: Windows XP build 2600 PHP Version: 4.3.7 New Comment: Ok, thanks =) Best wishes. Previous Comments: ------------------------------------------------------------------------ [2004-07-05 11:41:33] derick@php.net Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. . ------------------------------------------------------------------------ [2004-07-05 11:36:42] zxc at zmail dot ru Description: ------------ I want to have strings without \r\n from my conf file. Conf file: #>>>> ./inc/conf.inc.dat #>>>> key=value (with \r\n) //Line:0>path=./user-sleepy/ //Line:1>access=moder //Line:2>password=36Fhenw7spw But after parsing script, the code returns strings with \r\n, why? Maybe bug? Because i found in docs: "By default, PCRE treats the subject string as consisting of a single "line" of characters (even if it actually contains several newlines)". Reproduce code: --------------- <? function rconf($ConfPath) { $OpConf=@FOpen($ConfPath,"r") or die("Cannot read!"); while(!feof($OpConf)) { preg_match("/.+/",FGets($OpConf),$matches); echo $matches[0]; } FLock($OpConf,LOCK_EX); FClose($OpConf); } rconf("./inc/conf.inc.dat"); ?> Expected result: ---------------- path=./user-sleepy/access=moderpassword=36Fhenw7spw (without \r\n) Actual result: -------------- path=./user-sleepy/ access=moder password=36Fhenw7spw ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29014&edit=1

« previous php.bugs (#61692) next »