<?php
namespace KzykHys\Text;
class Text implements \Serializable
{
private $text;
public function __construct($text = '')
{
$this->text = (string) $text;
}
/**
* @param string $text
*/
public static function create($text = '')
{
return new static($text);
}
/**
* Append the string
*
* @param string $text
*
* @return Text
*/
public function append($text)
{
$this->text .= (string) $text;
return $this;
}PHP 拥有的多种函数可供创建、读取、上传以及编辑文本注意:请谨慎操作文本!当您操作文本时必须非常小心。如果您操作失误,可能会造成非常严重的破坏。常见的错误是:编辑错误的文本,被垃圾数据填满硬盘,意外删除文件内容