2

我正在开发一个允许用户查看在线 sqlite3 格式文件的 Web 解决方案(例如http://xxxxxx.AgentStatistic.csv.sqlite3)。现在我正在使用 php,并通过代码成功获取资源:

$url ="http://xxxxx.AgentStatistic.csv.sqlite3";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);

这将返回二进制代码,可以这样查看,一个长字符串(带有不可读的代码):

SQLite format 3@  -â!     iiƒSS…tableLitevsocial_reports_agentStatisticsLitevsocial_reports_agentStatisticsCREATE TABLE Litevsocial_reports_agentStatistics (reportTime,conversationId,dayPeriod,weekPeriod,monthPeriod,yearPeriod,agent,groupUser,dayLogin,weekLogin,monthLogin,yearLogin,assignedTo,assignedBy,composePublish,composeDraft,replyPublish,replyDraft,closed,waitingTime,slaReply,slaReplyOutside,slaClosed,slaClosedOutside)       Î ûöñìçâÝØÓÎ\S J A8/& /˜7Öu³Rñ/_ 3 +2013-06-03 17:43:3972579thisYearChris 00002000000112080160001_   3 +
.....(all rows with unreadable code like the first line)

结果包括我需要但不可读且格式错误的信息。我的问题:有没有一种方法可以根据我现有的代码正确解码 sqlite3 资源?还是有其他语言的其他解决方案?

4

0 回答 0