bestbuildpc: Forums
 

 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Modifying my phpinfo in a better way.
 
 
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> Tutorials
View previous topic :: View next topic  
Author Message
bestbuildpc
Site Admin
Site Admin


Joined: Jun 30, 2012
Posts: 213
Location: NL

PostPosted: Sun Jun 23, 2013 22:03    Post subject: Modifying my phpinfo in a better way. Reply with quote

I decided first to 'modify' the way my php_info() appears, allowing a listing of currently loaded extensions. Hope someone finds this useful.

Code:
<?php


// Get PHP INFO
ob_start();
phpinfo();
$phpinfo = ob_get_contents();
ob_end_clean();
$phpinfo = preg_replace ('/<\/div><\/body><\/html>/', '', $phpinfo);

//HR
$hr = '<div style="width:100%;background:#000; height:10px;margin-bottom:1em;"></div>'.PHP_EOL;

//GET EXT INFO
ob_start();
echo '<table border="0" cellpadding="3" width="600">'.PHP_EOL;
echo '<tr class="h"><td><a href="http://www.php.net/">';
echo '<img border="0" src="http://static.php.net/www.php.net/images/php.gif" alt="PHP Logo" />';
echo '</a><h1 class="p">PHP Extensions</h1>'.PHP_EOL;
echo '</td></tr>'.PHP_EOL;
echo '</table><br />'.PHP_EOL;
echo '<h2>Overview</h2>'.PHP_EOL;
echo '<table border="0" cellpadding="3" width="600">'.PHP_EOL;
echo '<tr><td class="e">Extensions</td><td class="v">'.PHP_EOL;
$exts = array();
foreach (get_loaded_extensions() as $ext) {
    $exts[] = $ext;
}
echo implode(', ', $exts).PHP_EOL;
echo '</td></tr></table><br />'.PHP_EOL;
echo '<h2>Details</h2>'.PHP_EOL;
echo '<table border="0" cellpadding="3" width="600">'.PHP_EOL;
foreach ($exts as $ext) {
    echo '<tr><td class="e">'.$ext.'</td><td class="v">';
        $funcs = array();
        foreach (get_extension_funcs($ext) as $func) {
            $funcs[] = $func;
        }
        echo implode(', ', $funcs).PHP_EOL;
    echo '</td></tr>'.PHP_EOL;
}
echo '</table><br />'.PHP_EOL;
echo '</div></body></html>'.PHP_EOL;
$extinfo = ob_get_contents();
ob_end_clean();

//OUTPUT
echo $phpinfo.$hr.$extinfo;

?>
  
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> Tutorials All times are GMT + 2 Hours
 
 Page 1 of 1

 

Jump to:   
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001-2008 phpBB Group
 
Forums ©