Created
June 27, 2014 03:23
-
-
Save randomecho/b64aafd18dc4972613dd to your computer and use it in GitHub Desktop.
Grab, strip and dump out phpinfo() into part of a page, neutering some of its overriding HTML and styles.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ob_start(); | |
phpinfo(); | |
$phpInfo = ob_get_clean(); | |
$phpInfo = preg_replace('/600(px)?/', '100%', $phpInfo); // table and hr width | |
$phpInfo = str_replace('75%', '95%', $phpInfo); // font-size | |
$phpInfo = preg_replace('/<?([\w]|<|\/|>)*(a:|!DOCTYPE|<html|title|body)(.+)?\\n?/', '', $phpInfo); // main html doc tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For PHP 5.6: