将每个dd mm yy转换为Unix时间,并插入Birthday_date字段中 [英] convert each dd mm yy to unix time and insert in birthday_date field
本文介绍了将每个dd mm yy转换为Unix时间,并插入Birthday_date字段中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请我想做一个很好的php函数,将我的html输入值转换成unixTime戳,然后插入到我的mysql表字段中
please i want to make a nice php function that convert my html input values into a unixTime stamp and than insert to my mysql table field
这是我的HTML代码
<input type="text" name="birthday_dd"/>
<input type="text" name="birthday_mm"/>
<input type="text" name="birthday_yy"/>
我在我的表单中有很多html字段,每个字段都带有_dd& _mm& _yy,所以我想合并这3个html输入值并将它们转换为unix timeStamp,然后再插入到Mysql Table字段中
i have a lots of this html fields in my form each one termin with _dd & _mm & _yy so i want to merge this 3 html input values and convert them into a unix timeStamp before insert into my Mysql Table field
推荐答案
使用 strtotime 方法,
e.g. $unix = strtotime("2014-11-10");
这篇关于将每个dd mm yy转换为Unix时间,并插入Birthday_date字段中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文