i have an PHP code like below. i use an array, looping, and function in my PHP code
<?php
$array_rows = array( 50, 60, 50, 50 );
$array_cols = array( 30, 20, 70, 30, 60 );
$costs = array(
array( 16, 16, 13, 22, 17 ),
array( 14, 14, 13, 19, 15 ),
array( 19, 19, 20, 23, 50 ),
array( 50, 12, 50, 15, 11 )
);
function diff($j, $len, $is_row, $res[3]) {
$i, $c, max($min1), $min2 = $min1, $min_p = -1;
for($i=0; $i<$len; ++$i) {
if(($is_row) ? $col_done[$i] : $row_done[$i]) continue;
$c = ($is_row) ? $costs[$j][$i] : $costs[$i][$j];
if($c < $min1) {
$min2 = $min1;
$min1 = $c;
$min_p = $i;
}
else if($c < $min2) $min2 = $c;
}
$res[0] = $min2 - $min1;
$res[1] = $min1;
$res[2] = $min_p;
}
?>
but why I get an Error :
Parse error: syntax error, unexpected '[', expecting ')' in C:\UwAmp\www\v.php on line 11
can somebody help my to fix my error code?