<?php
$data = Array (
"Ron" => Array
(
"subject1" => Array
(
"test1" => 47,
"test2" => 86,
"total" => 133,
"percentage" => 88.67,
"status" => "Pass",
"pass_count" => 8,
"fail_count" => 0,
"gross_total" => 963,
"gross_percentage" => 80.25,
)
"subject8" => Array
(
"test1" => 48,
"test2" => 86,
"total" => 134,
"percentage" => 89.33,
"status" => "Pass",
"pass_count" => 8,
"fail_count" => 0,
"gross_total" => 900,
"gross_percentage" => 75.50,
)
)
"John" => Array
(
"subject1" => Array
(
"test1" => 39,
"test2" => 72,
"total" => 111,
"percentage" => 74,
"status" => "Pass",
"pass_count" => 8,
"fail_count" => 0,
"gross_total" => 963,
"gross_percentage" => 80.25,
),
"subject8" => Array
(
"test1" => 39,
"test2" => 75,
"total" => 114,
"percentage" => 76,
"status" => "Pass",
"pass_count" => 8,
"fail_count" => 0,
"gross_total" => 846,
"gross_percentage" => 70.5,
)
)
);
$table = "<table>";
$tab;e .= table_cell($data);
$table .= "</table>";
echo $table;
function table_cell($data) {
$return = "<tr>";
foreach ($data as $key => $value)
$return .= "<td>$key</td><td>";
if (is_array($value)) {
$return .= table_cell($value);
} else {
$return .= $value;
}
$returm .= "</td>";
}
return($return);
$return .= "</tr>"
}
- Output for 5.4.0 - 5.4.27, 5.4.29 - 5.4.40, 5.5.24, 5.6.8
- Parse error: syntax error, unexpected '"subject8"' (T_CONSTANT_ENCAPSED_STRING), expecting ')' in /in/XWFGe on line 21
Process exited with code 255. - Output for 5.4.28
Process exited with code 137.- Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
- Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /in/XWFGe on line 21
Process exited with code 255. - Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
- Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /in/XWFGe on line 21
Process exited with code 255. - Output for 4.3.2 - 4.3.4
- Parse error: parse error, expecting `')'' in /in/XWFGe on line 21
Process exited with code 255.
preferences:
214.14 ms | 1399 KiB | 132 Q