if ($bbcode == strtoupper($bbcode)) { $bbarr = explode ('.', $bbcode); $bbcode = ""; foreach ($bbarr as $bbsentence) { $bbcode .= ucfirst(strtolower(ltrim($bbsentence))) . "."; } }