0
0

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 2016-05-20

データベースを作るほどの量は必要なかったのでベタで配列を作成。
配列まわりが相変わらずわかってないのでメモ。

手順

  1. からっぽの配列つくる
  2. 順に差し込む([2]とすれば2番目、[]だと一番後ろに入る)
// 手順1
$testData = [];

// 手順2
$testData[] = [
    "company" => "株式会社クエスチョン",
    "name" => "鈴木博",
    "kana" => "すずきひろし"
];
$testData[] = [
    "company" => "株式会社testtest",
    "name" => "山田太郎",
    "kana" => "やまだたろう"
];
$testData[] = [
    "company" => "さんかく(株)",
    "name" => "田中一郎",
    "kana" => "たなかいちろう"
];
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?