submitted string lowercase with strtolower() before invoking ucwords():
<?php $full_name = "tHis IS a tESt"; $full_name = ucwords( strtolower($full_name) ); print $full_name; ?>