$1',
'$1',
'$1',
'$1',
'',
'$1',
'$4',
'
$1
',
'$1
',
'$1
'
);
$count = count($in)-1;
for($i=0;$i<=$count;$i++)
{
$text = preg_replace($in[$i],$out[$i],$text);
}
return $text;
}
//Fonction permettant de convertir du html en du bbcode
function html_to_bbcode($text)
{
$text = str_replace('
','',$text);
$in = array(
'#(.*)#Usi',
'#(.*)#Usi',
'#(.*)#Usi',
'#(.*)#Usi',
'##Usi',
'#(.*)#Usi',
'#(.*)
#Usi',
'#(.*)
#Usi',
'#(.*)
#Usi'
);
$out = array(
'[b]$1[/b]',
'[i]$1[/i]',
'[u]$1[/u]',
'[s]$1[/s]',
'[img]$1[/img]',
'[url=$1]$2[/url]',
'[left]$1[/left]',
'[center]$1[/center]',
'[right]$1[/right]'
);
$count = count($in)-1;
for($i=0;$i<=$count;$i++)
{
$text = preg_replace($in[$i],$out[$i],$text);
}
return $text;
}
?>