ucwords

(PHP 3 >= 3.0.3, PHP 4, PHP 5)

ucwords --  Gør det første tegn i hvert ord til et stort bogstav

Beskrivelse

string ucwords ( string str )

Returnerer en streng med det første tegn af hvert ord i str som et stort bogstav, hvis dette tegn er alfabetisk.

Definitionen af et ord er enhver streng af tegn der forekommer efter et whitespace (Disse er: mellemrum, form-feed, linieskift, carriage return, horisontal tabulator and vertikal tabulator

Eksempel 1. ucwords() eksempel

<?php
$foo
= 'hello world!';
$foo = ucwords($foo);             // Hello World!

$bar = 'HELLO WORLD!';
$bar = ucwords($bar);             // HELLO WORLD!
$bar = ucwords(strtolower($bar)); // Hello World!
?>

Bemærk: Denne funktion er binary-safe.

Se også strtoupper(), strtolower() og ucfirst().