visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
294 experts, 1172 registered users, 1625 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


The DDRK link is back online.
We got a one week service interruption, sorry.
(23-30/01/2010)

Languages :: PHP :: PHP: TWO INNER "FOR I" CENTENCES ***URGENT***


By: excii U.S.A.  Date: 22/06/2003 00:00:00  English  Points: 50 Status: Answered
Quality : Excellent
Hi!

I am thinking why this is not possible or I just can't get it work:

for ($i=0;$i<count($variable1);$i++)
{

echo $variable1[$i];

for ($i=0;$i<count($variable2);$i++)
{
echo $variable2[$i];
}

}


Get the idea of that? Good :)

I need to do that... or something like that...

Regards,
excii
By: VGR Date: 23/06/2003 05:02:00 English  Type : Answer
why do you want to do this ? It's strictly forbidden by "good practices" and sometimes by compilers (modifying the loop variable inside the loop itself)

Perhaps this what you wanted ?


for ($i=0;$i<count($variable1);$i++) { // what is the link between $var2 and $var1 !!!?!!
//debug
echo $variable1[$i];
//
for ($j=$i;$j<count($variable2);$j++) {
echo $variable2[$j];
} // for $var2
} // for $var1





By: excii Date: 23/06/2003 05:21:00 English  Type : Comment
yeah... there is a link... database link...

that was just a simple sample :D



And I solved that myself, I mean that $j thing... you get points anyway :)




Do register to be able to answer

 Add This Article To:
 del.icio.usDel.icio.us  diggDigg  googleGoogle  spurlSpurl
 blinkBlink  wongWong  simpySimpy  yahooY! MyWeb 
EContact
browser fav
page generated in 62.127110 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page