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

(singke) #1

highlight_file(FILE);
?>


boolean highlight_string(string code)


The highlight_string function prints a string of PHP code to the browser using syntax
highlighting.


<?
//create some code
$code = "print(\"a string\");";
//highlight sample code
highlight_string($code);
?>


string get_html_translation_table (integer table)


Use get_html_translation_table to get the table used by htmlentities and
htmlspecialchars. By default the former is returned, but if table is 1, the table used by
htmlspecialchars is returned.


<?
$trans = get_html_translation_table(HTML_ENTITIES);


print("pre>");
var_dump($trans);
print("/pre>\n");
?>


integer get_magic_quotes_gpc()


The get_magic_quotes_gpc function returns the magic_quotes_gpc directive setting,
which controls whether quotes are escaped automatically in user-submitted data.


<?
if(get_magic_quotes_gpc() == 1)
{
print("magic_quotes_gpc is on");
}
else
{
print("magic_quotes_gpc is off");
}
?>

Free download pdf