note 14985 added to control-structures.for.php

From: Date: Thu, 23 Aug 2001 12:32:33 +0000
Subject: note 14985 added to control-structures.for.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-17019@lists.php.net to get a copy of this message
Could someone help me a little. This code should generate one SELECT-list from that logit.txt, but now it generates many of them...? ... if($action=="view") { $logfile = "logit.txt"; $data=file("$logfile"); foreach ($data as $record) { $subdata=explode("|",$record); echo "<FORM ACTION=\"testi3.php\">\n"; echo "<SELECT NAME=\"Joukkueet\">\n"; for ($index =0 ; $index < count ($subdata[1]); $index++) { echo "<OPTION VALUE=\"$subdata[1]\"> $subdata[1] </OPTION> \n"; } echo "</SELECT> \n"; echo "</FORM> \n"; } } ... http://www.php.net/manual/en/control-structures.for.php

« previous php.notes (#17019) next »