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

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

WBOY
WBOYOriginal
2016-06-13 11:51:331012browse

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 />   }

}
?>
这个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 />   }

}
?>

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

Statement:
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