dtvpl739577 2013-10-06 02:52
浏览 13

检查文件夹中的最后一个js / css文件

I am building up a simple PHP script to get all my site css/js files combined.

What I would like to do now is checking for the most recent built css or js file in the "cache" folder.

So... some function like:

function getLastFile('js'){
   return the js file name
}

function getLastFile('css'){
   return the css file name
}

I've found out solutions on the net on how to check for the last file in some folder... but how can I exactly check the last by a specific extension?

  • 写回答

2条回答 默认 最新

  • drmet46444 2013-10-06 03:01
    关注

    if u mean last as most recent built

    //get the last-modified-date of this very file
    $lastModifiedTime=filemtime($Cachedfile);
    

    or better have a look over the smartoptimizer Code , have a tiny look through its source u will surely get an idea

    评论

报告相同问题?

悬赏问题

  • ¥20 XP系统在重新启动后进不去桌面,一直黑屏。
  • ¥15 opencv图像处理,需要四个处理结果图
  • ¥15 无线移动边缘计算系统中的系统模型
  • ¥15 深度学习中的画图问题
  • ¥15 java报错:使用mybatis plus查询一个只返回一条数据的sql,却报错返回了1000多条
  • ¥15 Python报错怎么解决
  • ¥15 simulink如何调用DLL文件
  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统