Quote:
Originally Posted by Sora
Thank you for that. Is there any way to align an image to the left at all? Sorry, I don't use BBCodes that much.
|
Try wrapping it in a tag.
Here's a BBCode list, with HTML equivelents:
Code:
$text = preg_replace('|\[b\](.+?)\[\/b\]|i', '<strong>$1</strong>', $text);
$text = preg_replace('|\[i\](.+?)\[\/i\]|i', '<em>$1</em>', $text);
$text = preg_replace('|\[u\](.+?)\[\/u\]|i', '<u>$1</u>', $text);
$text = preg_replace('|\[img\](.+?)\[\/img\]|i', '<img src="$1" border="0">', $text);
$text = preg_replace('|\[url=(.+?)\](.+?)\[\/url\]|i', '<a href="$1" target="_blank">$2</a>', $text);
$text = preg_replace('|\[color=(.+?[^;])\](.+?)\[\/color\]|i', '<span style="color:$1;">$2</span>', $text);
$text = preg_replace('|\[size=(.+?[^;])\](.+?)\[\/size\]|i', '<span style="font-size:$1;">$2</span>', $text);
$text = preg_replace('|\[left\](.+?)\[\/left\]|i', '<span style="text-align: left;">$1</span>', $text);
$text = preg_replace('|\[right\](.+?)\[\/right\]|i', '<span style="text-align: right;">$1</span>', $text);
$text = preg_replace('|\[center\](.+?)\[\/center\]|i', '<center>$1</center>', $text);