When concatenating strings in a loop, avoid using the . operator repeatedly. Instead, use implode() with an array to reduce memory usage and improve performance.
.
implode()