Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
<?php
.........
// ###################### Start bbcodehandler_php #######################
function handle_bbcode_php($code)
{
global $vboptions, $vbphrase, $stylevar, $highlight_errors;
static $codefind, $codereplace, $regex, $regexreplace;
// remove empty codes
if (trim($code) == '')
{
return '';
}
//remove smilies
$code = strip_smilies(str_replace('\\"', '"', $code));
// get rid of leading newlines
$code = preg_replace("#^(( )*<br[^>]*>\r\n)*#s", '', chop($code));
if (!is_array($codefind))
{
$codefind = array(
'<br>', // <br> to nothing
'<br />', // <br /> to nothing
'>', // > to >
'<', // < to <
'&', // & to &
'"', // " to "
);
$codereplace = array(
'',
'',
'>',
'<',
'&',
'"',
);
}
// remove htmlspecialchars'd bits
$code = str_replace($codefind, $codereplace, $code);
// do we have an opening <? tag?
if (!preg_match('#^\s*<\?#si', $code))
{
// if not, replace leading newlines and stuff in a <?php tag and a closing tag at the end
$code = "<?php BEGIN__VBULLETIN__CODE__SNIPPET $code \r\nEND__VBULLETIN__CODE__SNIPPET ?>";
$addedtags = true;
}
else
{
$addedtags = false;
}
// highlight the string
$oldlevel = error_reporting(0);
if (PHP_VERSION >= '4.2.0')
{
$buffer = highlight_string($code, true);
}
else
{
@ob_start();
highlight_string($code);
$buffer = @ob_get_contents();
@ob_end_clean();
}
error_reporting($oldlevel);
// if we added tags above, now get rid of them from the resulting string
if ($addedtags)
{
$buffer = preg_replace(array(
'#(<|<)\?php( | )BEGIN__VBULLETIN__CODE__SNIPPET#siU',
'#END__VBULLETIN__CODE__SNIPPET( | )\?(>|>)#siU'
), '', $buffer);
}
//$buffer = str_replace('[', '[', $buffer);
$code = &$buffer;
eval('$html = "' . fetch_template('bbcode_php') . '";');
return $html;
}
.........
?>
Hm, was genau willst Du? Irgendwie versteh ich Deine Frage nich so rechtOriginal geschrieben von röme
Kann man PHP Code mit HTML Darstellen oder muss man dass mit PHP machen?
Die Funktion highlight_string() gibt den String str mit hervorgehobener Syntax (Syntax highlighting) aus. Dabei werden die Farben des in PHP eingebauten Syntax-Highlighter benutzt.
<?
$phphighlight = '
<?
// eingegebener Text
$test = "Hello World !";
// Ausgabe des Textes
echo "$test";
?>';
highlight_string($phphighlight);
?>