Problem with format of data to be sent with ether.browseUrl

I am using MINI ENC28J60 board. It works fine but I have problems with formating the dataCollection variable so that it can be sent with the ether.browseUrl. I need to collect several analogReads and send them to the server. Can anyone help me with this? I have tried sprintf and it works fine for few variables but I can not collect all the data into a String object and then put that into the sprintf. I have tried to collect the data into a char array but I get an error response from the server when I try to send it. The format of the dataCollection could be like 0,50,122,133,201,… or 000050122133201…
Any ideas on how I can get those int values into a char array and send it?

void loop () {
  sensorValue = analogRead(sensorPin);
  if(counter < 20){

   collecting data....

 if(counter == 20){

void sendData(char dataCollection[]){

  if (millis() > timer) {
    timer = millis() + 5000;
    Serial.println("<<< REQ ");
    ether.browseUrl(PSTR("/WebSite/WebService.asmx/LogValue?"), dataCollection, website, my_callback);

Any help would be much appreciated!

Just use itoa function and pass as the char buffer you want to write to the address of the current position of your array (maintain an index of where you are, then look for where the \0 has been written replace that with a coma and put the \0 next. The position of that \0 is where you want to point next time you call itoa().

Don't forget to reset your counter variable (as well as the index of where to write in the array) after sending the data otherwise you will only send once and then your buffer will grow like crazy as it will never be sent and your app will crash.

Thank you J-M-L I will try this