note 72194 deleted from function.preg-match-all by nlopess
| From: | nlopess@php.net | Date: | Sun, 07 Jan 2007 14:09:46 +0000 |
| Subject: | note 72194 deleted from function.preg-match-all by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-121382@lists.php.net to get a copy of this message | ||
Note Submitter: dev at cheechtech dot com
----
befitting the module example above
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;
}