You are here: Re: filtering xdebug ini keys « PHP Programming Language « IT news, forums, messages
Re: filtering xdebug ini keys

Posted by jemptymethod on 10/28/07 13:52

On Oct 28, 9:28 am, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
>
> To answer your question, something like (untested):
>
> <?php
> function _is_xdebug($string){
> return preg_match('/^xdebug/i',$string);}
>
> $all = ini_get_all();
> $keys = array_keys($all);
> $neededkeys = array_filter($keys,'_is_xdebug');
> $xdebug = array_intersect_key($all,array_flip($neededkeys));
> ?>

For "untested" that worked out of the box ;) Thanks very much for the
lesson on how to use these array_ functions.

My very first trace however indicates 17 milliseconds. And replacing
the regular expression with 0===strpos($string, 'xdebug') didn't even
save a 10th of a millisecond (0.016824 vs. 0.016918).

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация