2020年9月16日解決済み

$posts = [];は必要ですか?

ユーザー

まず、空の配列をつくるとありますが、なくても下記でも表示されまが、
やはり、必要でしょうか?

$posts[0] = ['text' => 'hello', 'likes' => 0];
$posts[1] = ['text' => 'hello again', 'likes' => 0];

 print_r($posts);
スタッフ

この回答を見るにはプレミアムプランへの登録が必要です

プレミアムプランとは?