note 44886 added to function.phpinfo

From: Date: Thu, 19 Aug 2004 08:47:34 +0000
Subject: note 44886 added to function.phpinfo
Groups: php.notes 
Request: Send a blank email to php-notes+get-74928@lists.php.net to get a copy of this message
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>"; ?> ---- Manual Page -- http://www.php.net/manual/en/function.phpinfo.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44886 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44886&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44886&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#74928) next »