How do I get my array to display correctly with column headers and values? Should I convert the array to a string first somehow? But then how do I get it to display right with columns and rows?
I’m getting data from a CSV file sent to an array called $data.
$data = curl_exec($ch);
When I echo the $data it looks like this…
CODE:
echo $data[0];
echo $data[1];
echo $data[2];
echo $data[3];
echo $data[4];
echo $data[5];
echo $data[6];
echo $data[7];
echo $data[8];
echo $data[9];
echo $data[10];
echo $data[11];
echo $data[12];
echo $data[13];
echo $data[14];
echo $data[15];
echo $data[16];
echo $data[17];
echo $data[18];
echo $data[19];
OUTPUT:
“number”,”priority”,
As you can already tell 0=”, 1=n, 2=u, 3=m 4=b, 5=e, 6=r, 7=”, 8=, etc. “number”,
The CSV file is returned as a string, so accessing
$data[1]is the same assubstr($data,1,1). The simplest way for you to do this would be to save it to a file and then usefgetcsv: