PHP ucwords(): Uppercase the first character of each word in a string accept 'and', 'to', etc

Posted by lauthiamkok on Stack Overflow See other posts from Stack Overflow or by lauthiamkok
Published on 2011-01-02T21:49:11Z Indexed on 2011/01/02 21:53 UTC
Read the original article Hit count: 231

Filed under:
|
|

hi,

How can I make upper-case the first character of each word in a string accept a couple of words which I don't want to transform them, like - and, to, etc?

For instance, I want this - ucwords('art and design') to output the string below,

'Art and Design'

is it possible to be like - strip_tags($text, '<p><a>') which we allow

and in the string?

or I should use something else? please advise!

thanks.

© Stack Overflow or respective owner

Related posts about php

Related posts about uppercase