Home > Backend Development > PHP Tutorial > php递归解决一个问题

php递归解决一个问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:31:13
Original
1080 people have browsed it

<code>function get_new_nums($days = 5)
{
    $custom_time = time() - 86400 * $days;
    $where['createtime > '] = $custom_time;
    $piano_nums = $this->yuepu_models->list_whrere($where, 'COUNT(1) AS nums');
    if ($piano_nums ;
    return $piano_nums;
}
get_new_nums();
</code>
Copy after login
Copy after login
Copy after login

直接echo的话,显示如下
140
97
64
22
0
0
我想返回大于100的值,就是那个140,但是现在用这个方法搞不定,返回的是0。
请大家帮忙看下该如何解决,谢谢了!

回复内容:

<code>function get_new_nums($days = 5)
{
    $custom_time = time() - 86400 * $days;
    $where['createtime > '] = $custom_time;
    $piano_nums = $this->yuepu_models->list_whrere($where, 'COUNT(1) AS nums');
    if ($piano_nums ;
    return $piano_nums;
}
get_new_nums();
</code>
Copy after login
Copy after login
Copy after login

直接echo的话,显示如下
140
97
64
22
0
0
我想返回大于100的值,就是那个140,但是现在用这个方法搞不定,返回的是0。
请大家帮忙看下该如何解决,谢谢了!

<code>function get_new_nums($days = 5)
{
    $custom_time = time() - 86400 * $days;
    $where['createtime > '] = $custom_time;
    $piano_nums = $this->yuepu_models->list_whrere($where, 'COUNT(1) AS nums');
    if ($piano_nums ;
    return $piano_nums;
}
get_new_nums();
</code>
Copy after login
Copy after login
Copy after login
Related labels:
php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template