<?php // BBC File function BBCodeCpp($content){ "and", "and_eq", "asm", "bitand", "bitor", "break", "case", "catch", "compl", "const_cast", "continue", "default", "delete", "do", "dynamic_cast", "else", "for", "fortran", "friend", "goto", "if", "new", "not", "not_eq", "operator", "or", "or_eq", "private", "protected", "public", "reinterpret_cast", "return", "sizeof", "static_cast", "switch", "this", "throw", "try", "typeid", "using", "while", "xor", "xor_eq" ); "auto", "bool", "char", "class", "const", "double", "enum", "explicit", "export", "extern", "float", "inline", "int", "long", "mutable", "namespace", "register", "short", "signed", "static", "struct", "template", "typedef", "typename", "union", "unsigned", "virtual", "void", "volatile", "wchar_t" ); $sao = array("=", "!", "~", "&", "?", "|", "^", "%", "+", "-", "*", "(", ")", "{", "}", "[","]", ".", ",", ":", "<", ">"); for($i=0;$i<sizeof($sao);++$i){ } //$content = str_replace("\n","<br />",$content); //$content = preg_replace('#(([a-z])\((.*?)\)#',' <span style="color: darkgoldenrod;">\\1(</span>\\2<span style="color: darkgoldenrod;">)</span>',$content); foreach($keywords1 AS $k1){ } foreach($keywords2 AS $k2){ } foreach($keywords3 AS $k3){ } return $content; } ?>
Ale nie wszystko działa jak powinno...
Tj. między znacznikami cytatu, komentarza itp jest kolorowane wszystko od słów kluczowych po liczby, liczby niezależnie czy są częścią zmiennej czy są "same" są kolorowane, to samo dotyczy separatorów i operatorów (chodzi o komentarze i quotowanie).
Ktoś mi powie jak to poprawić ?