LoginSignup
28
29

More than 5 years have passed since last update.

jQueryで配列をPOSTする

Posted at

今まで知らなかった。

下記だとPHP側で配列として扱えない

$.ajax({
    url: 'post.php',
    data: {
        'arr': ['foo', 'bar', 'baz']
    }
});

下記だとPHP側で配列として扱える

$.ajax({
    url: 'post.php',
    data: {
        'arr[]': ['foo', 'bar', 'baz']
    }
});

参考リンク

28
29
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
28
29