Codice PHP:
    function sost_semplice($stringa) {
        
$cercati = array("/\[b\]/""/\[p\]/""/\[ul\]/""/\[li\]/""/\[h1\]/""/\[h2\]/""/\[h3\]/""/\[h4\]/""/\[strong\]/""/\[\/b\]/""/\[\/p\]/""/\[\/ul\]/""/\[\/li\]/""/\[\/h1\]/""/\[\/h2\]/""/\[\/h3\]/""/\[\/h4\]/""/\[\/strong\]/""/\[br\]/");
        
$sostituti = array("[b]""

"
"<ul>""[*]""<h1>""<h2>""<h3>""<h4>""[b]""[/b]""</p>""[/list]""""<h1>""<h2>""<h3>""<h4>""[/b]""
"
);

        
$this->stringa preg_replace($cercati$sostituti$stringa);

        
preg_match_all("/\+([^+]+)\+/"$this->stringa$valore);

        
$img_link = array();

        foreach (
$valore[1] AS $dati) {
            
$img explode("|"$dati);
            
            
$img_link[] = '<span class="' $img[4] . '">' '[img]images/' $img[0] . '.png[/img]' '</span>';
        }

        
print_r($valore);
        
$this->stringa preg_replace($valore[0], $img_link$this->stringa);

        return 
$this->stringa;
    } 
edit: ehmmm ho sbagliato l'invio..