Voting

: min(zero, six)?
(Example: nine)

The Note You're Voting On

stalker at ruun dot de
19 years ago
to vouksh: I expanded your functions a bit:

<?php
function xhtmlHighlightString($str,$return=false) {
$hlt = highlight_string(stripslashes($str), true);
$fon = str_replace(array('<font ', '</font>'), array('<span ', '</span>'), $hlt);
$ret = preg_replace('#color="(.*?)"#', 'style="color: \\1"', $fon);
if(
$return)
return
$ret;
echo
$ret;
return
true;
}
function
xhtmlHighlightFile($path,$return=false) {
$hlt = highlight_file($path, true);
$fon = str_replace(array('<font ', '</font>'), array('<span ', '</span>'), $hlt);
$ret = preg_replace('#color="(.*?)"#', 'style="color: \\1"', $fon);
if(
$return)
return
$ret;
echo
$ret;
return
true;
}
?>

<< Back to user notes page

To Top