我无法让它工作。
如何将密钥更改[0]
为[id]
. 在下面的数组中。我希望[0] => 2
看起来像[id] => 2
数组例如:
Array
(
[pickup] => 2014/11/10 15:15
[tire_front] => tire_front
[service] => 4
[message] =>
[user] => 1
[0] => 2
)
我的php脚本:
<?php
if (isset($_POST['rep_list'])) {
//insert database connect script here
$workCard = $_POST['rep_list'];
array_push($workCard, $id);
print_r($workCard) ."<br>";
}
else{
echo("errorrrrr");
}
?>
解决了
<?php
if (isset($_POST['rep_list'])) {
//insert database connect script here
$workCard = $_POST['rep_list'];
$workCard['id'] = $id;
print_r($workCard) ."<br>";
}
else{
echo("errorrrrr");
}
?>