Używam w mojej klasie funkcji bb2html() podanej kiedyś na forum bodajże przez @scannera... Dla przypomnienia (nie znalazłem jej, więc nie podam linka):
<?php //jest kilka moich zmian odnośnie zgodności z W3C class content_manager { // ciach... (konstruktor, inne funkcje) function bb2html($str) { 'b' => 'font-weight: bold', 'u' => 'text-decoration: underline', 'i' => 'font-style: italic' ); foreach( $codesArr as $aKey => $aVal) { $str = preg_replace_callback(\"#[($aKey)+[=]?(http|https|ftp+://)?(.*?)](http|https|ftp+://)?(.*?)[/$aKey]#si\", \"$this -> repl\", $str); }; return $str; } function repl($matches) { { { $protocol = $matches[2]; } { $protocol = $matches[4]; } else { $protocol = 'http://'; }; switch($matches[1]) { case 'url': $x = '<'.implode( ' ', $codesArr[$matches[1]] ).$protocol.$address.'\">'.$matches[4].$matches[5].'</'.$codesArr[$matches[1]][0].'>'; break; case 'img': break; default: $x = '<'.implode( ' ', $codesArr[$matches[1]] ).$matches[3].'\">'.$matches[4].$matches[5].'</'.$codesArr[$matches[1]][0].'>'; break; } } else { $x = '<span style=\"'.$codesArr[$matches[1]].'\">'.$matches[5].'</span>'; } return $x; } }; ?>
o co teraz chodzi... chcę to wstawić w klasę... problem jest w tym, że gdy się do niej odwołuję (chcę przepuścić przez bb2html()) otrzymuję komunikat
Cytat
Warning: preg_replace_callback() requires argument 2, 'repl', to be a valid callback in C:\Serwer\Apache2\htdocs\doc\lbn\classes\content_manager.class.php on line 125 {tutaj linia 25-27}
Nie wiem, jak zmienić ten drugi argument w funkcji preg_replace_callback... wszystkie zmiany nic nie dają, próbowałem m. in. ze wstawieniem "$this -> repl", ale ciągle ten sam komunikat...
mam nadzieję, że jasno wytłumaczyłem

za wszelką pomoc z góry thx !