PHP Laravel 系列 - (3) 資料結構,資料量一多,正規的儲存方式 發表於 2021-10-12 更新於 2023-12-31 分類於 PHP , Laravel 623 1 分鐘 1. 陣列12345678$people = ['john','may','tim'];/*Array( [name] => john [age] => 55 )*/ 2. 字典式陣列12345678$student = ['name'=>'john','age'=> 55];/*Array( [name] => john [age] => 55)*/ 3. 迴圈操作123456789101112131415$students = [ ['name'=> 'kite' , 'grade'=> 100] ,['name'=> 'snow' , 'grade'=> 85]];foreach($students as $key => $student){ echo ('第'.$key.'個學生'.$student['name']. "\r\n");}/*第0個學生kite第1個學生snow*/