A non well formed numeric value encountered

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

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

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

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

$time = intval(时间戳);

posted @ 2017-05-17 17:03  kaoru  阅读(4283)  评论(0编辑  收藏  举报