I think you are converting an array to a string in your script. This usually happens when you get confused and pass the wrong variable name to a function, and really want to be passing a different variable. Or perhaps it is just that you have used a function incorrectly without realizing what it returns or what it takes as input.