note 28489 added to function.phpinfo
| From: | Todd at rack1 dot php dot net | Date: | Tue, 14 Jan 2003 18:12:23 +0000 |
| Subject: | note 28489 added to function.phpinfo | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-42139@lists.php.net to get a copy of this message | ||
As an additional note to the previous post, this same method can be used to email the contents of a
php info to yourself. This is handy in debug situations or if you want to keep an eye on something:
// start the output buffer, this means nothing will be displayed until the buffer is closed
ob_start();
// call the phpinfo function to display the php info
phpinfo();
// get contents of output buffer, which is everything that would have been printed from phpinfo();
$val_phpinfo .= ob_get_contents();
// flush the output buffer and delete the contents
ob_end_clean();
// get a substring of the php info to get rid of the html, head, title, etc.
$val_phpinfo = substr( $val_phpinfo, 554, -19 );
// replace the </td>'s with tabs and the $nbsp;'s with spaces
$val_phpinfo = str_replace( '</td>', ' ', $val_phpinfo );
$val_phpinfo = str_replace( ' ', ' ', $val_phpinfo );
// strip the tags
$val_phpinfo = strip_tags($val_phpinfo);
// email the conts.
mail($youremailaddress, "PHP INFO", $val_phpinfo, "From: $youremailaddress\nReply-To:
$youremailaddress");
--
http://www.php.net/manual/en/function.phpinfo.php
http://master.php.net/manage/user-notes.php?action=edit+28489
http://master.php.net/manage/user-notes.php?action=delete+28489
http://master.php.net/manage/user-notes.php?action=reject+28489