Guest huey4657 Posted August 11, 2006 Share Posted August 11, 2006 Hi all,Does anyone know how to increment a position within an array, these do not work:Loop$array[$cnt]++;$array[$cnt] = $array[$cnt]++;thks. Quote Link to comment Share on other sites More sharing options...
corbin Posted August 11, 2006 Share Posted August 11, 2006 haha sorry but your title made me laugh.Anyways i dont get what youre trying to do...?if youre just tryin to set new values you can just use something like$array = array();$array[] = "value1";$array[] = "value2";$array[] = "value3";$array[] = "value4";Then array[0] would be value1 [1] would be value2 and so on.......... Quote Link to comment Share on other sites More sharing options...
brown2005 Posted August 11, 2006 Share Posted August 11, 2006 lol, made me laugh too.. you might want to rephrase it... lmao Quote Link to comment Share on other sites More sharing options...
Guest huey4657 Posted August 11, 2006 Share Posted August 11, 2006 Hi,Basically I have 3 arrays with 18 counters that need updating in a while loop of (max) 300000+ records, the 18 counters increment when there is a match of 1 or 2-3 or >3 (3 arrays) in one field and depending on the other field which = between 1 and 18 that counter increments. So if row 1, field 1 = 1 that be a position in an array, and field 2 = between 2 and 3, the (2-3) array increments in position 1.And I would like anyhelp in how i can increment a part of an arrayHope this makes sense.Thnks for any help Quote Link to comment Share on other sites More sharing options...
Guest huey4657 Posted August 11, 2006 Share Posted August 11, 2006 Sorry, the problem wasn't the count it was the if(condition). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.