有没有一种方法可以显示没有PHP文件扩展名的URL

时间:2020-07-09 02:03:46

标签: php arrays

$link = $_SERVER['PHP_SELF'];
$link_array = explode('/u/', $link);
echo $_COOKIE[] = end($link_array);

有人知道我该如何删除4个字符,或者完全不同的方法。

1 个答案:

答案 0 :(得分:1)

使用基本名称功能

mostSellingProducts: async (_,{},ctx)=>{   
    
                const Products = await invoice.aggregate([
                     { $unwind: "$Saledetail" },
                     { $match: { "state" : 'PAID'}},
                     { $group: {
                        _id : "$Saledetail.id",
                        total: { $sum: '$Saledetail.totalline' }
                    }},
                    {
                        $lookup: {
                            from: 'dhproducts',
                            localField: '_id',
                            foreignField: "_id",
                            as: "producto" 
                        }
                    },
                    {
                        $limit: 4
                    },
                    {
                        $sort : {total: -1}
                    }
                    ]);
                console.log(Products);
                return Products;
   },