I am trying to use ucfirst on my variable:

$subject = ucfirst($_POST['subject']);

it dosnt seem to work properly for example:
I type test it outputs to Test - which is fine.
I type tEsT and it outputs as TEsT.

how can I change it so no matter what I type it outputs the first letter as a capital and the rest lowercase?