Documentation is available at utility.php
1 <?php
2 /**
3 * Example included file with utility functions
4 * @author Derick Rethans <derick@php.net>
5 * @version $Id: $
6 * @package PHPDocExample
7 * @modulegroup PHPDocExampleFunctions
8 * @module PHPDocExampleFunctions
9 */
10
11 /**
12 * Function to add numbers in arrays
13 *
14 * This function returns an array in which every element is the sum of the
15 * two corresponding elements in the input arrays.
16 * @since Version 0.9
17 * @param array $array1 The first input array
18 * @param array $array2 The second input array
19 * @return array
20 */
21 function sumElements ($array1, $array2)
22 {
23 $ret = $array1;
24
25 foreach ($array2 as $key => $element) {
26 if (isset ($ret[$key])) {
27 $ret[$key] += $element;
28 } else {
29 $ret[$key] = $element;
30 }
31 }
32 return $ret;
33 }
34 ?>
Documentation generated on Tue, 18 Nov 2003 17:22:35 +0100 by phpDocumentor 1.2.2