My problem is very similar to the one described here in this topic Create nested list from PHP array for dropdown select field The problem is that if investments are not consecu
I just solved your problem here on SO in another question
just replace ++$r with $r+1
++$r
$r+1
the "dash" now works great.