雖然如預期在本機PHP幾乎可以肯定的作品,接受的解決方案出現時應用到正在從Laravel控制器輸送到其觀點字符串什麼也不做。例如,要轉儲一個變量,我發現唯一有效的方法是提供e返回的值。例如,通過with
方法print_r ($_ENV , true)
,並將封閉的pre
標籤放入視圖中。
控制器:
$sDebugMessages = '$_ENV = '. print_r ($_ENV , true) ;
return view ('Info')->with ('sPageTitle' , 'What is My Praesidium Central Hub?')->with ('sDebugMessages' , $sDebugMessages) ;
查看:
pre>{{ $sDebugMessages }}</pre>
結果(刪節,其原因應該是ovvious:
$_ENV = Array
(
[APP_ENV] => local
[APP_KEY] => xxxxxxxxxxxxxxx
[APP_DEBUG] => true
[APP_LOG_LEVEL] => debug
[APP_URL] => https://localhost
[DB_CONNECTION] => mysql
[DB_HOST] => localhost:3306
[DB_DATABASE] => xxxxxxxxxxxxxxx
[DB_USERNAME] => xxxxxxxxxxxxxxx
[DB_PASSWORD] => xxxxxxxxxxxxxxx
[BROADCAST_DRIVER] => log
[CACHE_DRIVER] => file
[SESSION_DRIVER] => database
[QUEUE_DRIVER] => sync
[MAIL_DRIVER] => smtp
[MAIL_HOST] => xxxxxxxxxxxxxxx
[MAIL_PORT] => 587
[MAIL_ENCRYPTION] => tls
[MAIL_USERNAME] => xxxxxxxxxxxxxxx
[MAIL_PASSWORD] => xxxxxxxxxxxxxxx
[MAIL_FROM_ADDRESS] => xxxxxxxxxxxxxxx
[MAIL_FROM_NAME] => xxxxxxxxxxxxxxx
[MAIL_MODE] => xxxxxxxxxxxxxxx
[MAIL_MODE_EMAIL] => xxxxxxxxxxxxxxx
)
它的編碼d兩次,這看起來很不尋常。你是從純文本中得到的,還是已經解析過的XML編碼? – Bergi