试用代码:
while (!feof($resultFile)) {
$line = fgets ($resultFile);
echo $line;
$someArray = json_decode($line);
foreach ($someArray as $key => $value) {
echo $value["key"] . ", " . $value["status"] . "<br>";
}
}
Array ( [key] => XYZ-6680 [status] => Open [components] => API [currentVersion] => Release1.2 [expectedVersion] => Array ( ) [customerInfo] => Default Calendar when the delegate responds to those invitations. ) Array ( [key] => XYZ-3325 [status] => Closed [components] => API [currentVersion] => Release 1.0 [expectedVersion] => Array ( [0] => Array ( [self] => https:
线路输出:
{"key":"XYZ-6680","status":"Open","components":"API","currentVersion":"Release1.2","expectedVersion":[],"customerInfo":"Default Calendar when the delegate responds to those invitations."} X, X
O, O
A, A
R, R
,
D, D
{"key":"XYZ-3325","status":"Closed","components":"API","currentVersion":"Release 1.0","expectedVersion":[{"self":"https://bug.restify.com/rest/api/2/version/27771","id":"27771","name":"Release1.2","archived":false,"released":false}],"customerInfo":"Fixed a number of bugs related to DA: * CrossMailboxSearch: Group label was shown even when all setting items of the group were hidden on New Account dialog ([https://bug.goog.restify/show_bug.cgi?id=1542 Bug 1542]) * After performing a bulk migration, the Delegated Admin user encountered an `HTTP Error 403` when attempting to download the list of provisioned accounts ([https://bug.goog.restify/show_bug.cgi?id=1039 Bug 1039])"} X, X
C, C
A, A
R, R
,
F, F
{"key":"XYZ-223","status":"Closed","components":"API","currentVersion":"Release 1.3","expectedVersion":[{"self":"https://bug.restify.com/rest/api/2/version/29171","id":"29171","name":"Release1.2","archived":false,"released":false}],"customerInfo":"\"Default Calendar\" user preference, `zimbraPrefDefaultCalendarId`."}X, X
C, C
A, A
R, R
,
", "
JSON(结果文件内容):
{"key":"XYZ-6680","status":"Open","components":"API","currentVersion":"Release1.2","expectedVersion":[],"customerInfo":"Default Calendar when the delegate responds to those invitations."}
{"key":"XYZ-3325","status":"Closed","components":"API","currentVersion":"Release 1.0","expectedVersion":[{"self":"https://bug.restify.com/rest/api/2/version/27771","id":"27771","name":"Release1.2","archived":false,"released":false}],"customerInfo":"Fixed a number of bugs related to DA: * CrossMailboxSearch: Group label was shown even when all setting items of the group were hidden on New Account dialog ([https://bug.goog.restify/show_bug.cgi?id=1542 Bug 1542]) * After performing a bulk migration, the Delegated Admin user encountered an `HTTP Error 403` when attempting to download the list of provisioned accounts ([https://bug.goog.restify/show_bug.cgi?id=1039 Bug 1039])"}
{"key":"XYZ-223","status":"Closed","components":"API","currentVersion":"Release 1.3","expectedVersion":[{"self":"https://bug.restify.com/rest/api/2/version/29171","id":"29171","name":"Release1.2","archived":false,"released":false}],"customerInfo":"\"Default Calendar\" user preference, `zimbraPrefDefaultCalendarId`."}
键、状态、组件、currentVersion、expectedVersion、customerInfo的逐行值。