我一直在這裏拉我的頭髮,包括在這裏回顧問題(比如這個例子:Read var_dump data with PHP),但我只是沒有得到它。PHP - 如何從一個對象中檢索一個值
我試圖檢索以下值:
COM_USERS_REGISTRATION_SAVE_FAILED
,並存儲爲一個變量。這裏是絕對的爛攤子(我不知道),我試圖從檢索它(這是文本的最後一行):
object(UsersModelRegistration)#98 (9)
{ ["data:protected"]=> object(stdClass)#106 (1) {
["groups"]=> array(1) {
[0]=> string(1) "2" } }
["_forms:protected"]=> array(0) { }
["__state_set:protected"]=> NULL
["_db:protected"]=> object(JDatabaseMySQL)#15 (19) {
["name"]=> string(5) "mysql"
["nameQuote:protected"]=> string(1) "`"
["nullDate:protected"]=> string(19) "0000-00-00 00:00:00"
["dbMinimum:protected"]=> string(5) "5.0.4"
["_database:private"]=> string(15) "table_joomla"
["connection:protected"]=> resource(29) of type (mysql link)
["count:protected"]=> int(0)
["cursor:protected"]=> resource(83) of type (Unknown)
["debug:protected"]=> bool(false)
["limit:protected"]=> int(0)
["log:protected"]=> array(0) { }
["offset:protected"]=> int(0)
["sql:protected"]=> object(JDatabaseQueryMySQL)#126 (18) {
["db:protected"]=> *RECURSION*
["type:protected"]=> string(6) "select"
["element:protected"]=> NULL
["select:protected"]=> object(JDatabaseQueryElement)#127 (3) {
["name:protected"]=> string(6) "SELECT"
["elements:protected"]=> array(1) {[0]=> string(4) "`id`" }
["glue:protected"]=> string(1) "," }
["delete:protected"]=> NULL
["update:protected"]=> NULL
["insert:protected"]=> NULL
["from:protected"]=> object(JDatabaseQueryElement)#128 (3) {
["name:protected"]=> string(4) "FROM"
["elements:protected"]=> array(1) {
[0]=> string(10) "`#__users`" }
["glue:protected"]=> string(1) "," }
["join:protected"]=> NULL
["set:protected"]=> NULL
["where:protected"]=> object(JDatabaseQueryElement)#129 (3) {
["name:protected"]=> string(5) "WHERE"
["elements:protected"]=> array(2) {
[0]=> string(31) "`username` = '[email protected]'"
[1]=> string(9) "`id` != 0" }
["glue:protected"]=> string(5) " AND " }
["group:protected"]=> NULL ["having:protected"]=> NULL
["columns:protected"]=> NULL ["values:protected"]=> NULL
["order:protected"]=> NULL ["union:protected"]=> NULL
["autoIncrementField:protected"]=> NULL }
["tablePrefix:protected"]=> string(6) "s7kou_"
["utf:protected"]=> bool(true)
["errorNum:protected"]=> int(0)
["errorMsg:protected"]=> string(0) ""
["hasQuoted:protected"]=> bool(false)
["quoted:protected"]=> array(0) { } }
["name:protected"]=> string(12) "registration"
["option:protected"]=> string(9) "com_users"
["state:protected"]=> object(JObject)#99 (1) {
["_errors:protected"]=> array(0) { } }
["event_clean_cache:protected"]=> string(19) "onContentCleanCache"
["_errors:protected"]=> array(1) {
[0]=> string(34) "COM_USERS_REGISTRATION_SAVE_FAILED" } }
http://php.net/manual/en/language.oop5.visibility.php可能是相關的。 – Amber