note 77071 rejected from ref.array by nlopess

From: Date: Tue, 14 Aug 2007 10:32:51 +0000
Subject: note 77071 rejected from ref.array by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-129469@lists.php.net to get a copy of this message
Note Submitter: lecter_bg3 at hotmail dot com ---- look... this is my code: <? function searchstoreconcpt($yyear,$awcostt){ $j; for($j=0; $j<=sizeof($awcostt);$j++) { if($awcostt[$j]["yyear"] == $yyear) break; } if($j > sizeof($awcostt)) { $awcost[$j]["yyear"] = $yyear; return $awcost[$j]; } else { $awcostt[$j]["yyear"] .= " + 1"; return $awcostt[$j]; } } ?> <pre> <? $i=1; $awcost; $awcost[$i++] = searchstoreconcpt(2003,$awcost); $awcost[$i++] = searchstoreconcpt(2003,$awcost); $awcost[$i++] = searchstoreconcpt(2002,$awcost); $awcost[$i++] = searchstoreconcpt(2003,$awcost); $awcost[$i++] = searchstoreconcpt(2003,$awcost); $awcost[$i++] = searchstoreconcpt(2001,$awcost); print_r($awcost); ?> </pre> and this is my result: Array ( [1] => Array ( [yyear] => 2003 ) [2] => Array ( [yyear] => 2003 + 1 ) [3] => Array ( [yyear] => 2002 ) [4] => Array ( [yyear] => 2003 + 1 ) [5] => Array ( [yyear] => 2003 + 1 ) [6] => Array ( [yyear] => 2001 ) [7] => Array ( [yyear] => 2002 + 1 ) ) but... I want this result.... Array ( [1] => Array ( [yyear] => 2003 +1 +1 +1 ) [2] => Array ( [yyear] => 2002 +1 +1 ) [3] => Array ( [yyear] => 2001 ) ) I don't know if you can help me, please, i'm waitting for your answer

« previous php.notes (#129469) next »