date(format,timestamp) 函数可把时间戳格式化为可读性更好的日期和时间。。
format:必需。规定时间戳的格式。
timestamp:可选。规定时间戳。默认是当前的日期和时间。
strtotime(time,now) 函数将任何英文文本的日期时间描述解析为Unix时间戳。
time:必需。规定日期/时间字符串。
PHP7之后实现AEES加解密功能换成了openssl扩展,PHP之间的加解密相对来说变的简单了,但是对于要和JAVA等其他语言对接的时候就要非常注意了。
openssl_encrypt介绍
openssl_encrypt( string $data, string $method, string $key, int $options = 0, string $iv = "", string &$tag = null, string $aad = "", int $tag_length = 16 ): string|false参数说明:
PHP使用MIME base64(内置函数base64_encode)对数据进行编码。设计此种编码是为了使二进制数据可以通过非纯 8-bit 的传输层传输。
本文主要介绍使用Base64对图片进行编码。
图片转换为base64编码
读取图片到字符串,而后使用base64_encode进行进行编码然后拼接上前缀(data:image/png;base64,)即可。

问题描述
PHP开启错误输出后,PHP报错提示如下
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 131072 bytes) in xxxx.php on line xxx
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1099 bytes) in
问题分析
这个是由于可用内存已耗尽,所以终端报出了Allowed memory size of 134217728 bytes exhausted错误,因为PHP默认内存限制是128M,所以需要修改php.ini文件的memory_limit设置。