Google

NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.73 ">

ucwords

(PHP 3>= 3.0.3, PHP 4 )

ucwords --  Force le premier caractère de chaque mot d'une chaîne en majuscule

Description

string ucwords ( string str)

ucwords() met le premier caractère de chaque mot de la chaîne str si ce caractère est une lettre.

Exemple 1. Exemple avec ucwords()

<?php
$text = "marie a un petit agneau, et l'adore.";
$text = ucwords($text); // $text vaut : Marie A Un Petit Agneau, Et l'Adore.
?>

Note : La définition d'un mot est : une chaîne de caractères immédiatement après un caractère blanc (c'est-à-dire : espace, form-feed, nouvelle ligne, retour chariot, tabulation horizontale, et tabulation verticale).

Voir aussi strtoupper(), strtolower() et ucfirst().