Bug #16 [Com]: problem print in a for loop....
| From: | junxing dot lin at yahoo dot com | Date: | Mon, 29 Aug 2011 08:19:29 +0000 |
| Subject: | Bug #16 [Com]: problem print in a for loop.... | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-163046@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=16&edit=1
ID: 16
Comment by: junxing dot lin at yahoo dot com
Summary: problem print in a for loop....
Status: Closed
Type: Bug
Package: Parser error
Operating System: Solaris 2.5.1
PHP Version: 3.0b3
Block user comment: N
Private report: N
New Comment:
http://www.chishairstraighteners.net chi flat
iron
http://www.chishairstraighteners.net chi flat
irons
http://www.chishairstraighteners.net chi hair
straightener
http://www.chishairstraighteners.net chi hair
straighteners
Previous Comments:
------------------------------------------------------------------------
[1998-02-12 01:04:50] rasmus
I am unable to reproduce this. I am using the above script and it gives me <BR>'s after
each line in
both loops. Please try running this exact script. Perhaps you overlooked something and aren't
telling us about all the factors.
------------------------------------------------------------------------
[1998-01-27 23:07:03]
/* Here is the the setup of my vars, the array is loaded
up in some sql code not represented here. It loads up
fine
*/
$fieldstr = "id title prod_key filename bytes last_mod ".
"loc_type status_type type_type ram hd_mb ".
"sound_type mhz_type proc_type blurb";
$fieldarr = explode(" ", $fieldstr);
$arraylen = count($fieldarr);
/* This for loop does not put put a "<BR>\n" at the end
of every line.
*/
for ($i = 0; $i < $arraylen; $i++) {
$line = "$fieldarr[$i] = " . $$fieldarr[$i] . "<BR>\n";
print("$line");
}
/* but the following does */
for ($i = 0; $i < $arraylen; $i++) {
$line = "<BR>\n$fieldarr[$i] = " . $$fieldarr[$i];
print("$line");
}
/* Any ideas? */
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=16&edit=1