Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

You may use magic_quotes_runtime as an alias to set_magicquotes runtime.


register_shutdown_function(string function)


Use register_shutdown_function to cause PHP to execute a function after it has
parsed the entire script, including anything outside PHP tags. The shutdown function will
also be executed in the event of an error, timeout, or user abort.


Keep in mind that the shutdown function may be called after the connection to the
browser has been shut down, in which case using print makes little sense. In other words,
this isn't a good way to debug.


You may register more than one shutdown function. Each will be executed in the order
they were registered.


<?
function shutdown()
{
print("!-- Script Terminated -->\n");
}


register_shutdown_function("shutdown");
?>


integer set_magic_quotes_runtime(boolean setting)


Use set_magic_quotes_runtime to change whether quotes are escaped in data pulled
from a database. The original value is returned.


<?
//turn off magic_quotes_runtime
set_magic_quotes_runtime(0);
?>


string setlocale(string category, string locale)


The setlocale function modifies the locale information for PHP and returns the new
locale specification. FALSE is returned if an error occurs. The locale determines things
such as whether to use a comma or a period in floating-point numbers. Locale does not
affect how you write PHP scripts, only the output of some functions.


If the category argument is an empty string, the values for the categories will be set
from environment variables. If the category argument is zero, the current setting will be
returned. Otherwise, a category from Table 11.8 should be chosen.

Free download pdf