function printMatrixCorners($matrix) {
echo "left top corner: " . $matrix[0][0] . "\n";
echo "right top corner: " . $matrix[0][count($matrix[0]) - 1] . "\n";
echo "left bottom corner: " . $matrix[count($matrix) - 1][0] . "\n";
echo "right bottom corner: " . $matrix[count($matrix) - 1][count($matrix[0]) - 1] . "\n";
}
$matrix = array(
array(1, 2, 3, 4),
array(5, 6, 7, 8),
array(9, 3, 2, 0)
);
printMatrixCorners($matrix);
/*
run:
left top corner: 1
right top corner: 4
left bottom corner: 9
right bottom corner: 0
*/