Reputation: 9265
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?
Upvotes: 1
Views: 1524
Reputation: 324650
Related Functions are useful.
docs http://img196.imageshack.us/img196/2283/h21r.png
Upvotes: 6