I have a string `$name` that contains a first and last name e.g. `Bob Smith`, assuming the user types in `bob smith` I want to be able to capitalize the first letters of their first and last names.

I have tried this: `$bar = ucfirst(strtolower($bar)); // Hello world!` which only outputs `Bob smith`. How would one make it so that both the first and last name are capitalized?