Jump to content

Removing every second value and key from an array


madsovenielsen

Recommended Posts

HelloI have this array:

Array(40) [0]=> widget [1]=> debug [2]=> on [3]=> window [4]=> title [5]=> Sample Konfabulator Widget [6]=> name [7]=> main_window [8]=> width [9]=> 500 [10]=> height [11]=> 500	 [12]=> image [13]=> src [14]=> Images/Sun.png [15]=> name [16]=> sun1 [17]=> hOffset [18]=> 250 [19]=> vOffset [20]=> 250 [21]=> alignment [22]=> center	 [23]=> text [24]=> data [25]=> Click Here [26]=> size [27]=> 36 [28]=> style [29]=> bold [30]=> name [31]=> text1 [32]=> hOffset [33]=> 250 [34]=> vOffset [35]=> 100 [36]=> alignment [37]=> center [38]=> onMouseUp [39]=> sun1.opacity = (sun1.opacity / 100) * 90;

The output above is from my PHP inspired var_dump() functionHow do i remove every other key from it, beginning with [1]debugI can't seem to wrap my head around it at the moment :)Any suggestions are welcome./mads

Link to comment
Share on other sites

I don't use VB, but that might not matter. If I understand the problem, the solution is to work from the end of the array, not the beginning. That way the indexes stay the same as you work toward 0. HTH

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...