in reply to array to string

This is not converting an array to a string. To do that, one would typically use the join function.

You're simply iterating over an array (reference) and printing out each element.

You've been here quite some time, yes? Why don't you have your expected output and actual output or errors listed in your question?