I have an input field that I am trying to make sure is formatted correctly. It is getting class codes (i.e. ARTS 101) and inputting them to a database. I want to first check that there is a space between the characters and the numbers (so ARTS 101 as opposed to ARTS101). Is this the correct preg_replace to do that?
$code = preg_replace('^([A-Z]+)','^([A-Z]+) ',$input);