關鍵所以目前我有打印出的應用程序配置的PHP函數:打印內容和它們在PHP
function cconfig() {
global $config;
// If the user wants debug information shown:
if (SHOWDEBUG == true) {
// If there is config information to show
if (isset($config)) {
cout("Variable $config is set.", "debug");
foreach ($config as $current) {
echo $current."<br/>";
}
} else {
cout("Variable $config isn't set.", "debug");
}
}
}
輸出僅顯示陣列,它的值在$current
。例如:
Value1
Value2
Value3
我該如何編輯這個函數,而不是隻顯示給定鍵的值,它還顯示了鍵?
ConfigEntry1 = Value1
ConfigEntry2 = Value2
ConfigEntry3 = Value3
http://php.net/manual/en/control-structures.foreach.php –