Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个格式为“06/Apr/2010 13:24”的英国日期,我需要将其插入到 mysql 数据库日期字段中。
PHP strtotime 函数无法处理这个字符串——除了编写自定义函数之外,还有其他人有什么想法吗?
谢谢!
尝试将 / 替换为 -
strtotime(str_replace('/', '-', '06/Apr/2010 13:24'));
看起来您可以在空间上添加子字符串,然后在“/”上爆炸,然后能够让每个部分都可以使用。似乎很奇怪,还没有办法做到这一点......
怎么样
$date = strtotime(str_replace('/',' ',$date).":00");