|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-04-21 09:37 UTC] sniper@php.net
[2003-04-21 09:45 UTC] gfraley5 at earthlink dot net
[2003-04-21 09:54 UTC] sniper@php.net
[2003-04-21 10:27 UTC] gfraley5 at earthlink dot net
[2003-04-21 12:29 UTC] sniper@php.net
[2003-04-21 12:39 UTC] gfraley5 at earthlink dot net
[2003-04-29 08:21 UTC] jerry at reininger dot org
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 06:00:01 2025 UTC |
This works in 4.3.1 and prior but does not work in 4.3.2RC's and current CVS. <? $myArray[] = 'msgid'."\n"; $myArray[] = '1049987091'."\n"; $myArray[] = '1050930128'."\n"; $fp = fopen("problemFile.php",'w') or die("Unable to open file"); for ($i=0;$i<count($myArray);$i++) { if ($i==0) $prefx = "<? Header(\"HTTP/1.0 403 Forbidden\");exit; ?>\n"; else $prefx = ""; fwrite($fp,$prefx.$myArray[$i]); } fclose($fp); ?> The file looks like this, which is correct: <? Header("HTTP/1.0 403 Forbidden");exit; ?> msgid 1049987091 1050930128 However, under 4.3.2 the file looks like this: <? Header("HTTP/1.0 403 Forbidden");exit; ?> msgid1049987091 1050930128 If you modify the code to this, moving the header code to the array, it works under 4.3.2: <? $myArray[] = "<? Header(\"HTTP/1.0 403 Forbidden\");exit; ?>\n"; $myArray[] = 'msgid'."\n"; $myArray[] = '1049987091'."\n"; $myArray[] = '1050930128'."\n"; $fp = fopen("problemFile.php",'w') or die("Unable to open file"); for ($i=0;$i<count($myArray);$i++) { fwrite($fp,$myArray[$i]); echo nl2br($myArray[$i]); } fclose($fp); ?> The file is correct.