这是我用来从 MYSQL 返回的数据在 PHP 中创建数组的代码:-
foreach($empRecords->result_array() as $row) {
$tid = $row['transaction_id'];
$checkbox = '<input type="checkbox" name="check[]" value="'.$tid.'">';
$data[] = array(
$checkbox,
$row['transaction_id'],
$row['member_id'],
$row['member_name'],
);
}
我得到的结果是:-
Array
(
[0] => Array
(
[0] => <input type="checkbox" class="CheckedarrayCount" name="check[]" value="247">
[1] => 247
[2] => 101257
[3] => Nithin
)
[1] => Array
(
[0] => <input type="checkbox" class="CheckedarrayCount" name="check[]" value="249">
[1] => 249
[2] => 101258
[3] => Rekha
)
)
但这就是我得到的结果:-
{
"data": [
["\u003Cinput type=\"checkbox\" class=\"CheckedarrayCount\" name=\"check[]\" value=\"247\"\u003E", "247", "101257", Nithin\u003C\/a\u003E", ],
["\u003Cinput type=\"checkbox\" class=\"CheckedarrayCount\" name=\"check[]\" value=\"249\"\u003E", "249", "101258", "ERekha\u003C\/a\u003E"],
}
请帮忙!
尚方宝剑之说