- <script>
- function test(action,code,array){
- $.post('test.php',{
- action: action,
- code: code,
- 'array[]': array
- },function(response){
- });
- }
- </script>
- <input type="button" value="test" onclick="test('actionhere','codehere',{'option1':'value1','option2':'value2'})" />
How can I send that array JSON in the post?