dovresti usare qualcosa tipo:
codice:
while (preg_match("/\[quote(.*?)\](.*?)\[\/quote\]/si", $testo)){
      $msg = preg_replace_callback("/\[quote(.*?)\](.*?)\[\/quote\]/si",'parse_quote',$testo);
}
Codice PHP:
function parse_quote($matches){
      
//funzione per creare l'impaginazione