1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[PHP]配列をリクエストで投げる

Last updated at Posted at 2015-12-11

配列データをリクエストしたいときがたまにあります。

http://localhost/greenwich.php?p_data[74][1001]=2&p_data[74][1002]=25&p_data[74][1003]=25&p_data[74][1004]=25

こんな感じでGETでリクエストを投げると

PHPでは

$_GET["p_data"] = array( "74"=> array( "1001" => "1", "1002" => "2", "1003" => "3", "1004" => "4");

$_GET["p_data"]にこんな感じで多次元配列になります。

例では、一回のリクエストで商品番号74の項目選択肢番号1001,1002,1003,1004の在庫数をそれぞれ更新のためにGETしてるみたいな

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?