<HTML ><HEAD ><TITLE >register_shutdown_function</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="PHP Manual" HREF="index.html"><LINK REL="UP" TITLE="Function Handling functions" HREF="ref.funchand.html"><LINK REL="PREVIOUS" TITLE="get_defined_functions" HREF="function.get-defined-functions.html"><LINK REL="NEXT" TITLE="register_tick_function" HREF="function.register-tick-function.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.get-defined-functions.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.register-tick-function.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.register-shutdown-function" ></A >register_shutdown_function</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN29369" ></A ><P > (PHP 3>= 3.0.4, PHP 4 )</P >register_shutdown_function -- Register a function for execution on shutdown </DIV ><DIV CLASS="refsect1" ><A NAME="AEN29372" ></A ><H2 >Description</H2 >int <B CLASS="methodname" >register_shutdown_function</B > ( callback function)<BR ></BR ><P > Registers the function named by <TT CLASS="parameter" ><I >function</I ></TT > to be executed when script processing is complete. </P ><P > Multiple calls to <B CLASS="function" >register_shutdown_function()</B > can be made, and each will be called in the same order as they were registered. If you call <A HREF="function.exit.html" ><B CLASS="function" >exit()</B ></A > within one registered shutdown function, processing will stop completely and no other registered shutdown functions will be called. </P ><P > The registered shutdown functions are called after the request has been completed (including sending any output buffers), so it is not possible to send output to the browser using <A HREF="function.echo.html" ><B CLASS="function" >echo()</B ></A > or <A HREF="function.print.html" ><B CLASS="function" >print()</B ></A >, or retrieve the contents of any output buffers using <A HREF="function.ob-get-contents.html" ><B CLASS="function" >ob_get_contents()</B ></A >. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.get-defined-functions.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.register-tick-function.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >get_defined_functions</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.funchand.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >register_tick_function</TD ></TR ></TABLE ></DIV ></BODY ></HTML >