I have some code which checks to see whether a certain variable is an array. If it is, I would like to assign all the array values to a single, comma-separated PHP variable. Here is the code:
if (is_array($value)) {
//Need to assign the array variables to the PHP variable $files, but how?
$postdata.=$files;
} else {
$postdata.=$value;
}
I have tried to use $files = print_r(array_values($value)); but it does not seem to work for me. What am I doing wrong? Thanks.
$postdata .= implode(", ", $files);perhaps?implode().