I'm needing help converting the php array in red below. I've been able to convert some of the arrays to dictionaries but not sure what the best solution is since this is an array inside of an array .
$reg_rows=array();
$rc_count=0;
$reg_counter=0;
$hold_achtrndt="1970-01-01";
$hold_regpay_sort="0";
while ( ($row_rc=sqlsrv_fetch_assoc($result_rc)) )
{
if ( strtoupper(substr($row_rc['tb_value1'],4,1))=="Y" )
$reg_counter=count($reg_rows); //If the paymethod is set to require it's own deposit, increment
elseif ( $row_rc['regpay_sort']!=$hold_regpay_sort )
{
$reg_counter=count($reg_rows); //If the paymethod changes, increment so each different type is separated
$hold_regpay_sort=$row_rc['regpay_sort'];
}
**$reg_rows[$reg_counter][$row_rc['rc_code']]=$row_rc;** //THIS IS THE ARRAY I NEED HELP WITH
$rc_count++;
}
Maybe it would be easier if I showed you what I'm trying to get.Example below. where 0
and 1
would be the reg_counter and 5514
,5115
,5116
would be the $row_rc['rc_code']
and the array[78]
are the fields returned from SQL table.
$reg_rows[0][5515]{array[78]}
$reg_rows[1][5514]{array[78]}
$reg_rows[1][5516]{array[78]}