|
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]
|