thinkphp php7 Cannot use ‘String’ as class name as it is reserved

在使用php7的thinkphp框架在开启验证码的时候发现报错:Cannot use ‘String’ as class name as it is reserved 报错的原因:主要是php7把String定为关键字,而在thinkphp框架中有一个类用了string类名 解决方法: 1、将文件ThinkPHP\Library\Org\Util\String.class.php改名,例如复杂成Stringnew.class.php,……

PHP中file_put_contents追加和换行

在PHP的一些应用中需要写日志或者记录一些信息,这样的话。可以使用fopen(),fwrite()以及 fclose()这些进行操作。也可以简单的使用file_get_contents()和file_put_contents(). file_put_contents()写文件。默认的是重新写文件,也就是会替换原先的内容。追加的话使用参数FILE_APPEND。 int file_put_contents ( string fi……