PHP CURL 数组过滤器 - 日期变量

<?php


    $today = date("y-m-d");

    $filter = ['2019-06-18'];


    // Api Request

    $a = ordersRequest("statistics/list", array("idapp" => 11111));


    $links = $a['statistics']['grp_date'];

    $filtered = array_filter($links, function ($item) use ($filter) {

    return in_array($item['date'], $filter);

    });

    print_r($filtered);


     ?>

这个作品:


$filter = ['2019-06-02'];

但是我怎样才能在这个变量中获得当前日期?


$filter = ['$today'];

$filter = [$today];

$filter = date("y-m-d");

不适合我


人到中年有点甜
浏览 117回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP