note 72195 modified in function.phpinfo by danbrown

From: Date: Sun, 20 Jul 2008 00:57:17 +0000
Subject: note 72195 modified in function.phpinfo by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-141874@lists.php.net to get a copy of this message
same as above for configuration variables <?php function parsePHPConfig() { ob_start(); phpinfo(INFO_CONFIGURATION); $s = ob_get_contents(); ob_end_clean(); $a = $mtc = array(); if (preg_match_all('/<tr><td class="e">(.*?)<\/td><td class="v">(.*?)<\/td><td class="v">(.*?)<\/td><\/tr>/',$s,$mtc,PREG_SET_ORDER)) { foreach($mtc as $v){ if($v[2] == '<i>no value</i>') continue; $a[$v[1]] = $v[2]; } } return $a; } ?> --was-- same as above for configuration variables function parsePHPConfig() { ob_start(); phpinfo(INFO_CONFIGURATION); $s = ob_get_contents(); ob_end_clean(); $a = $mtc = array(); if (preg_match_all('/<tr><td class="e">(.*?)<\/td><td class="v">(.*?)<\/td><td class="v">(.*?)<\/td><\/tr>/',$s,$mtc,PREG_SET_ORDER)) { foreach($mtc as $v){ if($v[2] == '<i>no value</i>') continue; $a[$v[1]] = $v[2]; } } return $a; } http://php.net/manual/en/function.phpinfo.php

« previous php.notes (#141874) next »