note 97921 added to function.imageconvolution
| From: | phunction dot sf dot net at osu1 dot php dot net | Date: | Sun, 16 May 2010 04:20:21 +0000 |
| Subject: | note 97921 added to function.imageconvolution | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169297@lists.php.net to get a copy of this message | ||
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
?>
----
Server IP: 194.8.30.16
Probable Submitter: 95.136.98.19
----
Manual Page -- http://www.php.net/manual/en/function.imageconvolution.php
Edit -- https://master.php.net/note/edit/97921
Del: integrated -- https://master.php.net/note/delete/97921/integrated
Del: useless -- https://master.php.net/note/delete/97921/useless
Del: bad code -- https://master.php.net/note/delete/97921/bad+code
Del: spam -- https://master.php.net/note/delete/97921/spam
Del: non-english -- https://master.php.net/note/delete/97921/non-english
Del: in docs -- https://master.php.net/note/delete/97921/in+docs
Del: other reasons-- https://master.php.net/note/delete/97921
Reject -- https://master.php.net/note/reject/97921
Search -- https://master.php.net/manage/user-notes.php