Save PHPInfo to file

Saves the phpinfo() page to an file

Snippet information

Author:
Jonas John

License:
Public Domain

Language:
PHP

Created:
05/09/2006

Updated:
05/09/2006

Tags:
, , ,


function PHPInfo2File($target_file){
 
    ob_start();
    phpinfo();
    $info = ob_get_contents();
    ob_end_clean();
 
    $fp = fopen($target_file, "w+");
    fwrite($fp, $info);
    fclose($fp);
}


Found a bug? Or do you have a better solution for this?
Feel free to leave a message:

Add a comment


Leave a comment

Vlad October 16, 2009 at 17:48
ob_start();phpinfo();file_put_contents($filename, ob_get_clean());