note 28489 deleted from function.phpinfo by philip

From: Date: Wed, 06 Apr 2005 03:48:44 +0000
Subject: note 28489 deleted from function.phpinfo by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-87553@lists.php.net to get a copy of this message
Note Submitter: Todd ---- 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( '&nbsp;', ' ', $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");

« previous php.notes (#87553) next »