note 50155 deleted from function.phpinfo by nlopess
| From: | nlopess@php.net | Date: | Sun, 20 Feb 2005 13:08:04 +0000 |
| Subject: | note 50155 deleted from function.phpinfo by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-85279@lists.php.net to get a copy of this message | ||
Note Submitter: gnif at spacevs dot com
----
This is a horrible hack to get the current php config file, I wish there was a better way
<?PHP
function GetConfigFile() {
ob_start();
phpinfo(INFO_GENERAL);
$info = ob_get_clean();
preg_match('/\<tr\>\<td class\="e"\>Configuration File
\(php\.ini\) Path \<\/td\>\<td
class\="v"\>(.*?)\<\/td\>\<\/tr\>/', $info, $match);
return trim($match[1]);
}
?>
--
www.spacevs.com