php的數(shù)組下標(biāo)
```
$garbage = array(
"food waste" => "濕垃圾",
"plastic bottles" => "可回收垃圾",
"old newspapers" => "可回收垃圾",
"used batteries" => "有害垃圾"
);
```
這樣就通過鍵(如"food waste")來獲取對(duì)的值(如"濕垃圾"),實(shí)現(xiàn)對(duì)垃圾分類的智能化引導(dǎo)。
```
$exhibitors = array(
=> array("name" => "ABC公司", "product" => "電子產(chǎn)品"),
=> array("name" => "XYZ公司", "product" => "家具產(chǎn)品")
);
```
這樣就通過鍵(如或)來獲取對(duì)參展商的所有信息。
```
$sales_data = array(
array("month" => "Jan", "sales" => ),
array("month" => "Feb", "sales" => ),
array("month" => "Mar", "sales" => )
);
```
這樣就方便地獲取每個(gè)月的銷售數(shù)據(jù),進(jìn)而進(jìn)行各種數(shù)據(jù)分析。
```
$chemicals = array(
=> array("name" => "硫酸", "density" => , "color" => "無色"),
=> array("name" => "硝酸", "density" => , "color" => "黃色")
);
```
這樣就通過索引(如或)來獲取對(duì)化學(xué)物質(zhì)的各種屬性。