Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] preg_replace_callback + parseTagsRecursive
lukaszgolder
post 19.01.2010, 17:05:43
Post #1





Grupa: Zarejestrowani
Postów: 141
Pomógł: 17
Dołączył: 2.04.2008
Skąd: z Zabrza

Ostrzeżenie: (0%)
-----


Mam taką funkcje:

Kod
function parseTagsRecursive($string)
    {
        $regex = '#\[quote]((?:[^[]|\[(?!/?quote])|(?R))+)\[/quote]#';
    
        if(is_array($string)) {
            $input  = "<div class=\"quote\">\n";
            $input .= " <div class=\"top\"></div>\n";
            $input .= " <div class=\"mid\">";
            $input .= $string[1];
            $input .= " </div>";
            $input .= "</div>";
        }
    
        return preg_replace_callback($regex, 'parseTagsRecursive', $string);
    }


Wywołuje ją tak:
  1. $string = parseTagsRecursive($string);


W momencie kiedy $string zawiera [quote] Apache przestaje działać smile.gif

Serwer to XAMPP na Windows Vista, strona, a w tym przypadku forum budowane jest na cakePHP.

Jakieś pomysły?

PS: Parser na forum mógłby nie edytować BBCode wewnątrz
  1.  


Ten post edytował lukaszgolder 19.01.2010, 17:10:16
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 06:46