HỏiXin hàm php lấy ngày upload của file

10 bài đăng
06.11.2016 / 18:18
kayer
Bài đăng: 240
Member
Đã đủ 18 dấu + làm người lớn

Như vấn đề

06.11.2016 / 18:20
MrKen
Bài đăng: 2646
Trùm!
Vẫn là A N H

code lấy ngày upload file

PHP
  1. filemtime($filepath)
06.11.2016 / 18:39
kayer
Bài đăng: 240
Member
Đã đủ 18 dấu + làm người lớn
MrKen đã viết

code lấy ngày upload file

PHP
  1. filemtime($filepath)

Biến $filepath là đường dẫn file hả?

06.11.2016 / 18:47
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.

đúng rùi =));

vd 'image/favicon.ico'

06.11.2016 / 18:58
kayer
Bài đăng: 240
Member
Đã đủ 18 dấu + làm người lớn

Vậy khai báo thế này đúng không?

PHP
  1. <?php
  2. $filepath=$_FILES['uploadFile']['tmp_name'];
  3. $date_time=filemtime($filepath);
  4. echo'Ngày upload:'.$date_time.'<br>';
  5. ?>
Đã chỉnh sửa. kayer (06.11.2016 / 19:02)
06.11.2016 / 19:06
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.

=)) cái này khi upload lên rùi có căn cứ $_FILES nữa đâu :v

echo 'Ngày upload:'.filetime('image/favicon.ico').'<br>';

06.11.2016 / 19:29
kayer
Bài đăng: 240
Member
Đã đủ 18 dấu + làm người lớn
mad đã viết

=)) cái này khi upload lên rùi có căn cứ $_FILES nữa đâu :v

echo 'Ngày upload:'.filetime('image/favicon.ico').'&lt;br&gt;';

Nếu upload file lên một thư mục không tồn tại thì nó có tự tạo ra không?

06.11.2016 / 19:32
MrKen
Bài đăng: 2646
Trùm!
Vẫn là A N H

thử đi :)

06.11.2016 / 20:51
Admadm
Bài đăng: 5
Member
MrKen đã viết

thử đi :)

Anh xem,xem lỗi chỗ nào thế,:3

Ô1

{% if message_list=="" or message_list==null %}<br>{%if api.user_id==api.r.get('uid')%}<im gsrc="http://chimbuom.us /files/885341/muadat.png"/>

{% if api.r.get("uid")==api.user_id %}<br/><form action="main.php?id=ch_topic_h&uid=235823&uuid=[user_id]&back_url=%2Fuser_info.php%3Fuid%3D[user_id]%26view%3Dcharacter"style="display:inline"method="post"><input type="hidden"name="text"value="bare_land"/><small><input type="submit"class="nobutton"value="Mua"style="background:none;border:none;margin:0;padding:0;box-shadow:none;text-shadow:none;cursor:pointer;color:#ffcc33"/></form></small>{% endif %}

{%endif%}{%else%} {{message_list}}{%endif%}

Ô2

{# Tính thời gian trồng cây #}{% set time,date=message_date|split(" ")[1],message_date|split(" ")[0] %}{% set s,m,h,d,mo,y=time|split(":")[2],time|split(":")[1],time|split(":")[0],date|split("-")[2],date|split("-")[1],date|split("-")[0] %}{% set htg=post.published_at|date_modify("- "~y~" years - "~(mo-1)~" months - "~(d-1)~" days - "~h~" hours - "~m~" minutes - "~s~" seconds")|date("H:i:s d/m/Y") %}{% set atime,adate=htg|split(" ")[0],htg|split(" ")[1] %}{% set as,am,ah,ad,amo,ay=atime|split(":")[2],atime|split(":")[1],atime|split(":")[0],adate|split("/")[0],adate|split("/")[1],adate|split("/")[2] %}{% if ad < 2 and amo < 2 and ay < 1 %}{% set ktg = as am*60 ah*3600 %}{% set tl=10800-ktg %}{% else %}{% set ktg =999999 %}{% endif %}{# Ô đất trống #}{% if message=="bare_land" %}{% if api.r.get("uid")==api.user_id %}{# chính chủ #} <a href="/main.php?f=3553162&farm_id=235823&p=1"title="Trồng cây"><img src="/files/885341/{{message}}.png"alt="Ô 1"/></a><br/>{% if api.r.get("farm_id")=="22004"%}{%else%} {%endif%} {%else%} {# Khách cmnr #}

<img src="http://chimbuom.us/files/885341/{{message}}.png"alt="Ô 1"/>

{%endif%}{% endif %}{# Hiện ô đất, tên cây #}{% if ktg < 10800 and message!="bare_land" %}{% if message=="lua" %}

<img src="http://chimbuom.us/files/885341/lua.jpg"/>{% endif %}{% if message=="hoa" %}<img src="http://chimbuom.us/files/885341/hoachua.jpg"/>{% endif %}{% if message=="khom" %}<img src="http://chimbuom.us/files/885341/khomchua.jpg"/>{% endif %}{% if message=="carot" %}<img src="http://chimbuom.us/files/885341/carotchua.jpg"/> {% endif %}{% if message=="tomato" %}<img src="http://chimbuom.us/files/885341 /1-uong.png"/>{% endif %}

{% if message=="thanhlong" %}<img src="http://chimbuom.us/files/885341/thanhlongchua.png"/>{% endif %}{% if message=="dualeo" %}<img src="http://chimbuom.us/files/885341/dualeochua.png" />{% endif %}{% if message=="dualeo" %}<img src="http://chimbuom.us/files/885341/dualeochua.png"/>{% endif %}{% if message=="bap" %}<img src="http://chimbuom.us/files/885341/bapchua.png"/>{% endif %}{% if message=="catim" %}<img src="http://chimbuom.us/files/885341/catimchua.png"/> {% endif %}{% if message=="xoai" %}<img src="http://chimbuom.us/files/885341/xoaichua.png"/>{% endif %}{# Thời gian còn lại #}{% autoescape false %}{{'<br/><small>[<font color="yellow">'~(tl//3600)~'h'~((tl-(tl//3600)*3600)//60)~'</font>]</small>'}} {% endautoescape %}{% endif %}{# Thu hoạch #}{% if (message=="khom" or message=="lua" or message=="hoa" or message=="carot" or message=="tomato" or message=="thanhlong" or message=="dualeo" or message=="bap" or message=="catim" or message=="xoai") and (ktg >= 10800) and (ktg < 21600) %}{% if api.r.get("uid")==api.user_id %}{# Chính cmn chủ #}<form action="main.php?id=ch_topic_h&uid=235823&uuid=[user_id]&back_url=%2Fmain.php%3Ff%3D3553164"style="display:inline"method="post"><input type="hidden"name="text"value="bare_land"/><input type="image"src="http://chimbuom.us/files/885341/{{message}}.png"alt="Thu"class="left4"></form><br/>

{%else%} {# Khách cmn rồi #}

<img src="http://chimbuom.us/files/885341/{{message}}.png"alt="Thu"width="32"height="32"/><br/>

{% endif %}{% endif %}{# Cây chết :v #}{%if ktg >21600 and message!="bare_land" %}{% if api.r.get("uid")==api.user_id %}{# Chính cmn chủ #} <a href="/main.php?f=3553162&farm_id=235823&p=1"title="Trồng cây"><br><img src="http://isharecode.wapego.net/files/154586/eggplant.png"width="20"height="20"></a>{%else%}{# Khách #}<br><img src="http://isharecode.wapego.net/files/154586 /eggplant.png"width="20"height="20">{%endif%}<br><small>[<font color="ffcc00">chết</font>]</small>{% endif %}

07.11.2016 / 07:04
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.

code của chú ken, ko biết dụng chạm chỉnh sửa chỗ nào =))