在从数据库获取时间戳数据的时候返回的结果是varchar类型

然后在用date("Y-m-d H:i:s", 时间戳)的时候会报错A non well formed numeric value encountered

这是因为date()函数里的时间戳必须是int类型,

所以只要把获取之后的时间戳转为int类型即可

$time = intval(时间戳);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-19
  • 2021-04-19
  • 2021-12-28
  • 2021-12-06
猜你喜欢
  • 2021-09-06
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案