【发布时间】:2014-05-24 12:04:36
【问题描述】:
我想计算一个数据库查询生成了多少个字符。
在 PHP 中,我使用mysql_fetch_length。 CodeIgniter 中是否有等价的功能?
【问题讨论】:
-
首先停止使用/谈论mysql*家族
我想计算一个数据库查询生成了多少个字符。
在 PHP 中,我使用mysql_fetch_length。 CodeIgniter 中是否有等价的功能?
【问题讨论】:
“In Codeigniter”之于 php,就像“with jquery”之于 javascript,这些天来。这只是 php。
不,CI 没有这个。返回一个 row_array() 然后:
$row_array = ['test', 'this'];
$new_total = array_sum(array_map(function($value){$total = strlen($value);return $total;}, $row_array));
var_dump($new_total);
【讨论】: