|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-08-10 02:20 UTC] jax at uia dot net
This is not a core dump, but rather an output problem with preg_match. Here is a short script:
$someline = "Here is some line.\n";
if ( preg_match('/Here(.*)$/',$someline,$matches) ) {
$out = $matches[1];
}
print "<pre>[$out]</pre>";
$out now contains no newline when this clearly should be included!
--Liam
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 18:00:02 2025 UTC |
add an "s" to the end of your reg exp. if (preg_match('/Here(.*)$/s',$someline,$matches)){ ^ this mean "treat everything as one line" and it will parse the newline.