I've done this in the past but no longer have what I wrote and can't remember how I did it previously. In correcting some user input, say "THIS IS AN ITEM" to "This is an item", I of course use
ucfirst(strtolower($text))
however it's no use when $text = "4 temperature controls"
I'm sure I had this sorted so "4 Temperature controls" was the output but can find no reference to ucfirst skipping non alphabet characters
Use regex for that:
ucfirst()is simply not the use-case here, since it can not predict your following characters, it's working with first character always.