"...Oh Wind. If Winter comes, can Spring be far behind?" -- Ode to the West Wind Percy Bysshe Shelley |
// [left] and [/left] for left align.
$text = str_replace("[left]", '<div align="left">', $text);
$text = str_replace("[/left]", '</div>', $text);
// [center] and [/center] for centered.
$text = str_replace("[center]", '<div align="center">', $text);
$text = str_replace("[/center]", '</div>', $text);
// [right] and [/right] for right align.
$text = str_replace("[right]", '<div align="right">', $text);
$text = str_replace("[/right]", '</div>', $text);
// [table] and [/table] for a table.
$text = str_replace("[table]", '<table style="font: inherit; color: inherit;">', $text);
$text = str_replace("[/table]", '</table>', $text);
// [tr] and [/tr] for a table row.
$text = str_replace("[tr]", '<tr>', $text);
$text = str_replace("[/tr]", '</tr>', $text);
// [td] and [/td] for a table cell.
$text = str_replace("[td]", '<td valign="top" style="font: inherit; color: inherit;">', $text);
$text = str_replace("[/td]", '</td>', $text);
// [sup] and [/sup] for superscript.
$text = str_replace("[sup]", '<sup>', $text);
$text = str_replace("[/sup]", '</sup>', $text);
// [sub] and [/sub] for subscript.
$text = str_replace("[sub]", '<sub>', $text);
$text = str_replace("[/sub]", '</sub>', $text);