This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / a php array problemnow i have a program in using array something like
$ary=array(1=>...,2=>...,...); my problem is, instead of hard coded 1,2,..., i need to use variables in a loop. something like for ($i=0;$i<xxx;$i++){ $i=>...}. and put the $is into array().thanks for help.
-jsfli06(书法爱好者);
2006-9-26
{258}
(#3230346@0)
-
($i=0;$i<xxx;$i++) $ary[]='some stuff';
-canadiantire(轮胎-pax et lux);
2006-9-26
(#3230383@0)
-
有点糊涂问题在于怎样把一个又一个的ary[$i] 放进根arrary()里.我太笨,请你进一步解释一下,多谢.
-jsfli06(书法爱好者);
2006-9-26
{82}
(#3230442@0)
-
foreach($ary as $item) {
$array[] = $item;
}
-647i(流浪的步行万里);
2006-9-26
(#3230458@0)
-
foreach($ary as $i=> $item) {
$array[$i] = $item;
}
-647i(流浪的步行万里);
2006-9-26
(#3230464@0)
-
This is the best.Thank you all for great helps. and sorry for so silly of myself.
By the way, if your people like 书法, please have a look at http://ca.pg.photos.yahoo.com/ph/jnli_98/album?.dir=3211re2&.src=ph&store=&prodid=&.done=http%3a//ca.pg.photos.yahoo.com/ph//my_photos
and i can give you what you like.
take care, my friends.
-jsfli06(书法爱好者);
2006-9-27
{319}
(#3231493@0)
-
do u use brush pen write php code?
-647i(流浪的步行万里);
2006-9-27
(#3231501@0)
-
sometimes and use keyboard for 书法 as well.
-jsfli06(书法爱好者);
2006-9-27
(#3231610@0)
-
saw your brush hand writing. Good!! do u mean give hardcopy, or softcopy?
-647i(流浪的步行万里);
2006-9-27
(#3232411@0)
-
real one for sure and hope you like it.
-jsfli06(书法爱好者);
2006-9-27
(#3232655@0)