Implement the StringBuilder class of asp.net in PHP
/*************************************** * ****** Function name: stringBuilder * for use: construct the StringBuilder class under PHP * for: Xue Hu blog * for Source: http://www.xuehuwang.com/* day: *************************************** * *****/class StringBuilder {const LINE ="
"; Protected $ list = array (''); public function _ construct ($ str = NULL) {array_push ($ this-> list, $ str );} public function Append ($ str) {array_push ($ this-> list, $ str); return $ this;} public function AppendLine ($ str) {array_push ($ this-> list, $ str. self: LINE); return $ this;} public function AppendFormat ($ str, mixed $ args) {array_push ($ this-> list, sprintf ($ str, $ args); return $ this;} public function ToString () {return implode ("", $ this-> list);} public function _ destruct () {unset ($ this-> list );}}