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