/* We do not have to perform the M_Monitor() loop * because we are in blocking mode */ if (M_ReturnStatus($conn, $identifier) != M_SUCCESS) { echo "Audit failed\r\n"; M_DestroyConn($conn); return; } if (!M_IsCommaDelimited($conn, $identifier)) { echo "Not a comma delimited response!\r\n"; M_DestroyConn($conn); return; } /* Print the raw, unparsed data */ 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";
function MCVE_ParseCommaDelimited(&$conn, $id) { return M_ParseCommaDelimited($conn, $id); }