update page now
Longhorn PHP 2026 - Call For Papers

Voting

: zero plus two?
(Example: nine)

The Note You're Voting On

phunction.sf.net
16 years ago
You don't need any custom function to calculate the $divisor of the $matrix, using array_map() and array_sum() does the trick:

<?php

$matrix = array
(
    array(-1, -1, -1),
    array(-1, 16, -1),
    array(-1, -1, -1),
);

$divisor = array_sum(array_map('array_sum', $matrix)); // 8

?>

<< Back to user notes page

To Top