.01
.02
.03
.04
.05
.06
.07
.08
.09
.10
.11
.12
.13
.14
.15
.16
.17
.18
.19
.20
.21
.22
.23
.24
.25
.26
.27
.28
.29
.30
.31
.32
.33
.34
.35
.36
.37
.38
.39
.40
.41
.42
.43
.44
.45
.46
.47
.48
.49
.50
.51
.52
.53
.54
.55
.56
.57
|
|
<?php
/******************************************************************************/
/* */
/* __ ____ */
/* ___ / / ___ / __/__ __ _____________ ___ */
/* / _ \/ _ \/ _ \_\ \/ _ \/ // / __/ __/ -_|_-< */
/* / .__/_//_/ .__/___/\___/\_,_/_/ \__/\__/___/ */
/* /_/ /_/ */
/* */
/* */
/******************************************************************************/
/* */
/* Titre : Colorisation de code php valide xhtml */
/* */
/* URL : http://www.phpsources.org/scripts165-PHP.htm */
/* Auteur : TommyWeb */
/* Date édition : 03 Mars 2006 */
/* Website auteur : http://www.tommyweb.org */
/* */
/******************************************************************************/
function colorisationphp($string)
{
$string = highlight_string($string, true);
$in = array(
'`<(?:font color="|span style="color: )'.
ini_get('highlight.html').'">(.+?)</(?:font|span)>`si',
'`<(?:font color="|span style="color: )'.
ini_get('highlight.comment').'">(.+?)</(?:font|span)>`si',
'`<(?:font color="|span style="color: )'.
ini_get('highlight.default').'">(.+?)</(?:font|span)>`si',
'`<(?:font color="|span style="color: )'.
ini_get('highlight.keyword').'">(.+?)</(?:font|span)>`si',
'`<(?:font color="|span style="color: )'.
ini_get('highlight.string').'">(.+?)</(?:font|span)>`si',
'`</(?:font|span)>`si'
);
$out = array(
'<span style="color: '.
ini_get('highlight.html').'">$1</span>',
'<span style="color: '.
ini_get('highlight.comment').'">$1</span>',
'<span style="color: '.
ini_get('highlight.default').'">$1</span>',
'<span style="color: '.
ini_get('highlight.keyword').'">$1</span>',
'<span style="color: '.
ini_get('highlight.string').'">$1</span>',
'</span>'
);
return preg_replace($in, $out, $string);
}
?>
|