Il faut utiliser les regex en php. Tu peux même inventer ton BBcode.
Si tu veux prendre le mien par exemple:
$texte = nl2br($texte); //pour mettre des <br/> lors des retours à la ligne
$texte = preg_replace('#\[gras\](.+)\/gras\#isU', '<b>$1</b>', $texte); //pour mettre en gras
$texte = preg_replace('#\[italique\](.+)\/italique\#isU', '<i>$1</i>', $texte); //pour mettre en italique
$texte = preg_replace('#\[souligne\](.+)\/souligne\#isU', '<u>$1</u>', $texte); //pour souligner
$texte = preg_replace('#:\)#', '<img src="sourire.png" />', $texte); //cette ligne et les 22 suivantes c'est pour mettre des images.
$texte = preg_replace('#:\(#', '<img src="triste.png" />', $texte);
$texte = preg_replace('#O_O#i', '<img src="wouaw.png" />', $texte);
$texte = preg_replace('#\*-\)#', '<img src="pensif.png" />', $texte);
$texte = preg_replace('#:@#', '<img src="grrr.png" />', $texte);
$texte = preg_replace('#:\$#', '<img src="gene.png" />', $texte);
$texte = preg_replace('#;\)#', '<img src="clindoeil.gif" />', $texte);
$texte = preg_replace('#\(a\)#i', '<img src="ange.png" />', $texte);
$texte = preg_replace('#:\)#', '<img src="sourire.png" />', $texte);
$texte = preg_replace('#:s#i', '<img src="=s.png" />', $texte);
$texte = preg_replace('#:p#i', '<img src="=p.png" />', $texte);
$texte = preg_replace('#:d#i', '<img src="content.png" />', $texte);
$texte = preg_replace('#-_-#', '<img src="-_-.png" />', $texte);
$texte = preg_replace('#\^\^#', '<img src="^^.png" />', $texte);
$texte = preg_replace('#\(h\)#i', '<img src="(h).png" />', $texte);
$texte = preg_replace('#\(k\)#i', '<img src="(k).png" />', $texte);
$texte = preg_replace('#\(l\)#i', '<img src="(l).png" />', $texte);
$texte = preg_replace('#=D#i', '<img src="grossourire.png" />', $texte);
$texte = preg_replace('#\[fiouu\]#', '<img src="fiou.png" />', $texte);
$texte = preg_replace('#\[inlove\]#', '<img src="inlove.png" />', $texte);
$texte = preg_replace('#\[fou\]#', '<img src="fou.png" />', $texte);
$texte = preg_replace('#\[clown\]#', '<img src="clown.png" />', $texte);
$texte = preg_replace('#xd#i', '<img src="xd.png" />', $texte);
$texte = preg_replace('#\[centre\](.+)\/centre\#isU', '<div style="text-align:center;">$1</div>', $texte); // pour centrer
$texte = preg_replace('#\[couleur=(\#[a-z0-9]{6})\](.+)\/couleur\#isU', '<span style="color:$1;">$2</span>', $texte); // pour la couleur.
$texte = preg_replace('#\[taille=([0-9]{2})\](.+)\/taille\#isU', '<span style="font-size:$1;">$2</span>', $texte); //pour la taille
$texte = preg_replace('#http://[a-z0-9._/-]+#i', '<a href="$0">$0</a>', $texte); // pour les liens.
J'espère que sa peut t'être utile. Pour apprendre à te servir des regx, vas sur le site du zéro dans le tuto php/mysql.
Bonne soirée^^
Je débute dans le monde de l'informatique...