echo "Raw Data:\r\n" . M_GetCommaDelimited($conn, $identifier) . "\r\n"; /* Tell the API to parse the Data */ if (!M_ParseCommaDelimited($conn, $identifier)) { echo "Parsing comma delimited data failed"; M_DestroyConn($conn); return; } /* Retrieve each number of rows/columns */ $rows = M_NumRows($conn, $identifier); $columns = M_NumColumns($conn, $identifier); /* Print all the headers separated by |'s */ for ($i = 0; $i < $columns; $i++) { if ($i != 0) { echo "|"; } echo M_GetHeader($conn, $identifier, $i); } echo "\r\n"; /* Print one row per line, each cell separated by |'s */ for ($j = 0; $j < $rows; $j++) { for ($i = 0; $i < $columns; $i++) { if ($i != 0) { echo "|"; } echo M_GetCellByNum($conn, $identifier, $i, $j); } echo "\r\n"; } /* * Use M_GetCell instead of M_GetCellByNum if you need a * specific column, as the results will allow for position-
function MCVE_GetHeader(&$conn, $id, $col) { return M_GetHeader($conn, $id, $col); }