codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Using shift while looping through multidimensional array using foreach  seisner at 13:52 on Thursday, February 21, 2008
 

Does anyone have any advice on how to chop off the first member in a multidimensional array?

Here's some sample data:

492000 200003 108352 2008
492000 200003 108352 2007
492000 200003 108352 2006
492000 200003 108352 2005

Here's some sample code:

foreach ( @memArray )
{

#do some stuff
shift(@memArray)
}

When I use shift within the foreach loop, it seems to be removing the wrong "rows" in the array. Has anyone had any experience with this? Any help would be much appreciated.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Web Development Project
•  Using shift while looping through multidimensional array using foreach
•  Doubt regarding JSP
•  Well formed DHTML in Blogger template
•  Re: Rewrite this program with good style
•  Re: Non dereferencable iterator C++
•  How would I make a cell in a table randomly turn red every 300 ms ?
•  Displaying First day of the Current Week
•  Displaying First day of the Current Week


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008