Reply to Re: Simple question about for loops & an array

Your name:

Reply:


Posted by Norman Peelman on 12/01/06 12:36

<insideview@gmail.com> wrote in message
news:1164955518.342567.147210@f1g2000cwa.googlegroups.com...
> Hi, I've got this loop, and don't know how to express a variable:
>
> I have:
>
> <? $count=0; while($count<$total) { $string1 = ($some array stuff....
>
> Bascially, I want it to work this way
>
> <? $count=0; while($count<$total) { $string[$count] = ($some array
> stuff....
>
> so I there it would generate $string1, $string2, ... etc.... but this
> doesn't work since I am assigning it to AN ARRAY!
>
> I thought
>
> <? $count=0; while($count<$total) { $string . $count = ($some array
> stuff....
>
> But no go. How would I work this out? :)
>

This is what you want... i'm not sure it's considered good programming
practice but it works...

$count=0;
while($count < $total)
{
${"string$count"} = ??????
...
$count++;
}



Norm
--
FREE Avatar hosting at www.easyavatar.com

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация