Mark Mark - 2 months ago 44
PHP Question

StringBuilder for PHP

Has someone made a

StringBuilder
implementation in PHP?

Answer

Why do you want to use a StringBuilder? Strings in php are mutable. Therefore performance is not an issue.

Just build string like this

$string = "start";
$string .= "appended string";
$string .= "appended string";
etc.