這是我的PHP函數PHP數組想擁有價值
public function pointComplete() {
$inputs = Input::all();
print_r("<pre>");
print_r($inputs);
print_r("</pre>");
}
輸出如下:
Array
(
[_token] => 2lIrWksIlJHjHASKAS0UDDSYLtcYwsDYCuxhjQ32
[complete] => Complete
[post_id_9] => 1
[post_id_10] =>
[post_id_12] => 2
[post_id_13] =>
[post_id_14] =>
)
我想這個PHP數組:
array (
"post1" => array(
"id" => "9",
"point" => "1"
),
"post2" => array(
"id" => "12",
"point" => "1"
)
);
那已經在數組 –
但我只想輸入post_id = 9,value = 1和post_id = 12,value = 2 –
抱歉,現在有人真的知道你在問什麼 –