Re: Capitalization of variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



you could explode the string by the " " space, then use the ucword function walking through the array, then implode

http://www.php.net/manual/en/function.explode.php
http://www.php.net/manual/en/function.ucwords.php
http://www.php.net/manual/en/function.array-walk.php
http://www.php.net/manual/en/function.implode.php

others:
http://www.php.net/manual/en/function.ucfirst.php
http://www.php.net/manual/en/ref.strings.php

Dmitrii Varvashenia wrote:
2008/6/19 Ron Piggott <ron.php@xxxxxxxxxxxxxxxxxx>:
How would I do this for a street address?

If the user gave me their address as "12 george street" I would like the
results to be 12 George Street.

For web I use CSS: text-transform:capitalize;



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux