The code is as follows: |
Copy code |
<? Php $ Team = array ('LK ',' OK '); $ Book = array ('Linux server configuration and management', $ team ); Foreach ($ book as $ k => $ val) // meaning for $ book each $ value () If (is_array ($ val) foreach ($ val as $ value) echo $ value. '<br/> '; Else echo $ k. '=>'. $ val. '<br/> '; ?> |
The output is:
0 => linux server configuration and management
Lk
OK
Method 2
The code is as follows: |
Copy code |
$ Arr = array (); Foreach ($ row_mark as $ arr) { Print_r ("<tr> "); Foreach ($ arr as $ k => $ v) { Print_r ("<td width = '80'>". $ v. "</td> "); } Print_r ("</tr> "); } |
Case 3
$ Arr = array (
Array ('name' => 'Www .111cn.net standby last', 'URL' => '? Action = config & do = config '),
Array ('name' => 'configuration of verification codes ', 'URL' => '? Action = config & do = seccode '),
Array ('name' => 'template management', 'URL' => 'Www .111cn.net? Action = config & do = tpl '),
Array ('name' => 'account management', 'URL' => '? Action = admin & do = list '),
Array ('name' => 'Add account ', 'URL' => '? Action = admin & do = add '));
Foreach ($ arr as $ k => $ val ){
Echo "name:". $ val ["name"]. "n ";
}