Hi I am new and would like to have this idea criticized. I wrote a working script in attempt to ensure that an entered value is printed as capitalized but i feel it is cumbersome and should be much more simple. If anyone would like to comment on this I would greatly appreciate it.
$strg = trim($_POST[‘user_char_name’]);
$finder = ‘/^[a-z]/’;
if (preg_match($finder, $strg , $matches)){
$up_cvar = strtoupper($matches[0]);
$user_cname = preg_replace($finder , $up_cvar , $strg);
} else {
$user_cname = trim($_POST[‘user_char_name’]);
}