3 * @version v5.20.16 12-Jan-2020
4 * @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
5 * @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
6 * Released under both BSD license and Lesser GPL library license.
7 * Whenever there is any discrepancy between the two licenses,
8 * the BSD license will take precedence.
10 * Set tabs to 4 for best viewing.
12 * Latest version is available at http://adodb.org/
14 * Requires PHP4.01pl2 or later because it uses include_once
18 Filter all fields and all rows in a recordset and returns the
19 processed recordset. We scroll to the beginning of the new recordset
22 We pass a recordset and function name to RSFilter($rs,'rowfunc');
23 and the function will be called multiple times, once
24 for each row in the recordset. The function will be passed
25 an array containing one row repeatedly.
29 // ucwords() every element in the recordset
30 function do_ucwords(&$arr,$rs)
32 foreach($arr as $k => $v) {
33 $arr[$k] = ucwords($v);
36 $rs = RSFilter($rs,'do_ucwords');
38 function RSFilter($rs,$fn)
40 if ($rs->databaseType
!= 'array') {
41 if (!$rs->connection
) return false;
43 $rs = $rs->connection
->_rs2rs($rs);
45 $rows = $rs->RecordCount();
46 for ($i=0; $i < $rows; $i++
) {
50 $obj->$method ($rs->_array
[$i],$rs);
52 $fn($rs->_array
[$i],$rs);
58 $rs->fields
= $rs->_array
[0];