Can anyone please explain me how string handling is done in PHP. Is it the same as that of done with Java or any other way round. Is there anything like java's StringBuffer class in PHP which will improve the performance of my code while handlling strings.
Please shed light on this.
Strings are mutable in php. The only reason something like a StringBuilder
is necessary in Java is because String
s are immutable. You can use the concatenation operator (.
) all you want.
Strings are handled in PHP without much fuss or need for additional libraries (unless you want to start using stuff like UTF-8 encoding).
Native PHP strings are mutable just like the StringBuffer class.
The manual is a good place to start.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With