I've created a function that cleans a posted title.
function title_var($title_variable) {
$title_variable = mysql_real_escape_string(ucwords(strtolower(trim(htmlspecialchars($title_variable, ENT_QUOTES)))));
return stripslashes($title_variable);
}
I now need to be able to make anything between () or [] all uppercase. For instance "my business name (cbs) limited" or "my business name [cbs] limited", becomes "My Business Name (CBS) Limited", with "CBS" being in all capitals.
I've done the first part of making all the words capital, I just need a way of making anything between the brackets capital.