我有一個數組在PHP中,我有一個輸入字段,我想知道如何讓我的值在輸入字段中的數組?需要發佈到PHP和jQuery數組?
array(
"message"=>$_POST['test'],
"others"=>"blah"
)
<input type="text" id="putIntoArray" >
<a href="#" onclick="jqueryPOST(this.value);">Post</a>
function jqueryPOST(value){
var message = $("#putIntoArray").val();
//I dont know how to put this value into "message" array?
}
因此,與郵政鏈接,它應該把輸入值放入數組「消息」,但不知道如何?這也是最好的方法嗎?
謝謝!
怎麼樣$ _ POST [ '測試']? – hellomello 2012-02-16 07:08:46
我有一個數組了,我不是要創建一個數組。我試圖將輸入值推送到現有的數組中。 – hellomello 2012-02-16 07:09:26
oops,將參數錯誤地命名。更新。 – Joseph 2012-02-16 07:10:05