3

ucnatwords

ucnatwords
SYNOPSIS

ucnatwords($s)

DESCRIPTION
CODE
  1. require_once 'strflat.php';
  2.  
  3. function ucnatwords($s) {
  4.     // capitalize first letter in every word after removing accents
  5.     return preg_replace_callback("#(^|[ '~-])(\w+)#", function($e) { return $e[1].strtoupper($e[2][0]).substr($e[2], 1); }, strtolower(strflat($s)));
  6. }
SEE ALSO

strflat

Comments

To add a comment, click here.