从对象取消设置多维数组的值

时间:2016-10-19 05:15:50

标签: php sorting elements

如何从此数组中取消设置所有setsystemtime元素? 这是php的4.4版本 这是我的代码中的实例的输出:

  2016-10-19T00:54:41-04:00 INFO (6): Array
(
    [ * _bootstrap] => Bootstrap Object
        (
            [_appNamespace:protected] => 
            [_resourceLoader:protected] => 
            [_application:protected] => PEP_Application Object
                (
                    [_autoloader:protected] => PEP_Autoloader Object
                        (


                            [_defaultAutoloader:protected] => Array
                                (
                                    [0] => PEP_Loader
                                    [1] => loadClass
                                )

                            [_fallbackAutoloader:protected] => 
                            [_internalAutoloader:protected] => Array
                                (
                                    [0] => PEP_Autoloader Object
 *RECURSION*
                                    [1] => _autoload
                                )

                            [_namespaces:protected] => Array
                                (
                                    [Zend_] => 1
                                    [ZendX_] => 1
                                    [WDPRO_] => 1
                                    [PEP_] => 1
                                    [controllers_helpers_] => 1
                                    [Guzzle] => 1
                                    [Symfony] => 1
                                )

                            [_suppressNotFoundWarnings:protected] => 
                            [_zfPath:protected] => 
                        )

                    [_bootstrap:protected] => Bootstrap Object
 *RECURSION*
                    [_environment:protected] => local
                    [_optionKeys:protected] => Array
                        (
                            [0] => phpsettings
                            [1] => includepaths
                            [2] => bootstrap
                            [3] => resources
                            [4] => deviceprofiling
                            [5] => pluginpaths
                            [6] => autoloadernamespaces
                        )

                    [_options:protected] => Array
                        (

                            [resources] => Array
                                (
                                    [frontController] => Array
                                        (
                                            [controllerDirectory] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/controllers
                                            [moduleDirectory] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/modules
                                        )

                                    [layout] => Array
                                        (
                                            [layoutPath] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/layouts/scripts
                                        )

                                    [setsystemtime] => Array
                                        (
                                            [load] => 1
                                        )

                                    [session] => Array
                                        (
                                            [strict] => 1
                                        )

                                    [modules] => Array
                                        (
                                            [0] => api
                                            [1] => trip
                                            [2] => tickets
                                            [3] => events
                                            [4] => passes
                                            [5] => plan
                                            [6] => resortaddons
                                            [7] => debugutils
                                            [8] => visa-instant-credit
                                        )

                                    [view] => 
                                    [log] => Array
                                        (
                                            [logConfig] => /configs/log.ini
                                        )

                                    [stats] => Array
                                        (
                                            [serviceLogLevel] => INFO
                                            [requestResponseLogLevel] => DEBUG
                                            [viewLogLevel] => INFO
                                            [actionLogLevel] => INFO
                                            [appLogLevel] => INFO
                                            [memoryLogLevel] => DEBUG
                                        )

                                    [serviceSuccessLog] => Array
                                        (
                                            [logConfig] => /configs/serviceSuccessLog.ini
                                        )

                                )

                            [deviceprofiling] => Array
                                (
                                    [cookieName] => WDPROView
                                    [timeToLive] => 604800
                                    [cookiePath] => /
                                    [enabled] => 1
                                    [routeBlackList] => Array
                                        (
                                            [0] => /api
                                            [1] => /utils
                                        )

                                )

                            [pluginpaths] => Array
                                (
                                    [PEP_Stats_Resource_] => PEP/Stats/Resource
                                    [PEP_Application_Resource_] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/../library/PEP/Application/Resource
                                    [Default_Resource_] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/resource
                                )

                            [autoloadernamespaces] => Array
                                (
                                    [0] => WDPRO_
                                    [1] => Zend_
                                    [2] => PEP_
                                    [3] => controllers_helpers_
                                    [4] => Guzzle
                                    [5] => Symfony
                                )

                        )

                )





            [_environment:protected] => 
            [_optionKeys:protected] => Array
                (
                    [0] => phpsettings
                    [1] => includepaths
                    [2] => bootstrap
                    [3] => resources
                    [4] => deviceprofiling
                    [5] => pluginpaths
                    [6] => autoloadernamespaces
                )

            [_options:protected] => Array
                (
                    [phpSettings] => Array
                        (
                            [log_errors] => 1
                            [date] => Array
                                (
                                    [timezone] => America/New_York
                                )

                            [display_startup_errors] => 0
                            [display_errors] => 1
                            [error_reporting] => 32767
                            [error_log] => C:\LodgingPhp\com-ui-php\target/logs/php_error.log
                        )

                    [includePaths] => Array
                        (
                            [library] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/../library
                        )

                    [bootstrap] => Array
                        (
                            [path] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/Bootstrap.php
                            [class] => Bootstrap
                        )

                    [resources] => Array
                        (
                            [frontController] => Array
                                (
                                    [controllerDirectory] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/controllers
                                    [moduleDirectory] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/modules
                                )

                            [layout] => Array
                                (
                                    [layoutPath] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/layouts/scripts
                                )

                            [setsystemtime] => Array
                                (
                                    [load] => 1
                                )

                            [session] => Array
                                (
                                    [strict] => 1
                                )

                            [modules] => Array
                                (
                                    [0] => api
                                    [1] => trip
                                    [2] => tickets
                                    [3] => events
                                    [4] => passes
                                    [5] => plan
                                    [6] => resortaddons
                                    [7] => debugutils
                                    [8] => visa-instant-credit
                                )

                            [view] => 
                            [log] => Array
                                (
                                    [logConfig] => /configs/log.ini
                                )

                            [stats] => Array
                                (
                                    [serviceLogLevel] => INFO
                                    [requestResponseLogLevel] => DEBUG
                                    [viewLogLevel] => INFO
                                    [actionLogLevel] => INFO
                                    [appLogLevel] => INFO
                                    [memoryLogLevel] => DEBUG
                                )

                            [serviceSuccessLog] => Array
                                (
                                    [logConfig] => /configs/serviceSuccessLog.ini
                                )

                        )

                    [deviceprofiling] => Array
                        (
                            [cookieName] => WDPROView
                            [timeToLive] => 604800
                            [cookiePath] => /
                            [enabled] => 1
                            [routeBlackList] => Array
                                (
                                    [0] => /api
                                    [1] => /utils
                                )

                        )

                    [pluginpaths] => Array
                        (
                            [PEP_Stats_Resource_] => PEP/Stats/Resource
                            [PEP_Application_Resource_] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/../library/PEP/Application/Resource
                            [Default_Resource_] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/resource
                        )

                    [autoloadernamespaces] => Array
                        (
                            [0] => WDPRO_
                            [1] => Zend_
                            [2] => PEP_
                            [3] => controllers_helpers_
                            [4] => Guzzle
                            [5] => Symfony
                        )

                )

            [_pluginLoader:protected] => 
            [_pluginResources:protected] => Array
                (
                    [layout] => Array
                        (
                            [layoutPath] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/layouts/scripts
                        )

                    [setsystemtime] => Array
                        (
                            [load] => 1
                        )

                    [session] => Array
                        (
                            [strict] => 1
                        )

                    [modules] => Array
                        (
                            [0] => api
                            [1] => trip
                            [2] => tickets
                            [3] => events
                            [4] => passes
                            [5] => plan
                            [6] => resortaddons
                            [7] => debugutils
                            [8] => visa-instant-credit
                        )

                    [view] => 
                    [log] => Array
                        (
                            [logConfig] => /configs/log.ini
                        )

                    [stats] => Array
                        (
                            [serviceLogLevel] => INFO
                            [requestResponseLogLevel] => DEBUG
                            [viewLogLevel] => INFO
                            [actionLogLevel] => INFO
                            [appLogLevel] => INFO
                            [memoryLogLevel] => DEBUG
                        )

                    [serviceSuccessLog] => Array
                        (
                            [logConfig] => /configs/serviceSuccessLog.ini
                        )

                    [frontcontroller] => Zend_Application_Resource_Frontcontroller Object
                        (
                            [_front:protected] => 
                            [_bootstrap:protected] => Bootstrap Object
 *RECURSION*
                            [_options:protected] => Array
                                (
                                    [controllerDirectory] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/controllers
                                    [moduleDirectory] => C:\LodgingPhp\com-ui-php\target\packaged-application\application/modules
                                )

                            [_skipOptions:protected] => Array
                                (
                                    [0] => options
                                    [1] => config
                                )

                        )

                )

            [_run:protected] => Array
                (
                    [0] => autoload
                )

            [_started:protected] => Array
                (
                    [core] => 1
                )

        )

    [ * _options] => Array
        (
        )

    [ * _skipOptions] => Array
        (
            [0] => options
            [1] => config
        )

)

我试过这样的事情和未设置的一些变化并没有让工作......任何想法?

foreach($a as $key => $b)
{
    if($b == 'setsystemtime')
    {
        unset($a[$key]);
    }
}

寻找其他答案我也试试这个:

foreach (array_keys($a, 'setsystemtime' , true) as $key) {
    $logger->info('encontro a setsystem time!!!!!');
    unset($a[$key]);
}

但永远不要进入它。

谢谢大家!!

0 个答案:

没有答案