Home > Backend Development > PHP Tutorial > php通过amf 与flex 通信,小弟我调试发现,只要有date()函数,flex返回就报错

php通过amf 与flex 通信,小弟我调试发现,只要有date()函数,flex返回就报错

WBOY
Release: 2016-06-13 11:51:33
Original
1010 people have browsed it

php通过amf 与flex 通信,我调试发现,只要有date()函数,flex返回就报错
a.php

<br /><?php<br />class edit_img<br />{<br />   function gmtime()<br />   {<br />    $temp = date('Z');<br />    return $temp;<br />   }
Copy after login

}
?>
这个php通过 amf 与flex 通信,我调试发现,只要有date()函数,flex返回就报错。

amf是2.1.1版,反复想不通这个问题

a.php
<br /><?php<br />class edit_img<br />{<br />   function gmtime()<br />   {<br />    $temp = time(); //这样就正常<br />    return $temp;<br />   }
Copy after login

}
?>

------解决方案--------------------
估计是没有指定时区,导致使用date()函数的warning。
php中屏蔽warning级错误,或者在php中加上 date_default_timezone_set("Asia/Shanghai");

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template