note 44886 deleted from function.phpinfo by aidan
| From: | aidan@php.net | Date: | Thu, 19 Aug 2004 10:05:50 +0000 |
| Subject: | note 44886 deleted from function.phpinfo by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74932@lists.php.net to get a copy of this message | ||
Note Submitter: adamlee000 at yahoo dot com
----
I found that, running php in CLI mode, phpinfo() will give plain text information. This is hard to
read. I tried this chunk of code. It worked for me:
<?
ob_start();
phpinfo();
$phpinfo1 = ob_get_contents();
ob_end_clean();
echo "<table border='1' bordercolor='#884444' cellspacing='0'
cellpadding='3'>";
$phpinfo = split( "\n", $phpinfo1 );
for( $i = 0; $i < sizeof( $phpinfo ); $i++ ) {
$info = split( " => ", $phpinfo[$i] );
if ( $info[1] === null ) {
echo "<tr><td colspan='2'><b>" . $info[0] .
"</b></td></tr>";
} else {
echo "<tr><td>" . $info[0] . "</td><td>" . $info[1] .
"</td></tr>";
}
}
echo "</table>";
?>