String 関数
PHP Manual

ucwords

(PHP 4, PHP 5)

ucwords文字列の各単語の最初の文字を大文字にする

説明

string ucwords ( string $str )

文字がアルファベットの場合、str の各単語の最初の文字を大文字にしたものを返します。

単語の定義は、空白文字 (スペース、フォームフィード、改行、キャリッジリターン、 水平タブ、垂直タブ) の直後にあるあらゆる文字からなる文字列です。

パラメータ

str

入力文字列。

返り値

変更後の文字列を返します。

例1 ucwords() の例

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

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

注意

注意: この関数はバイナリデータに対応しています。

参考


String 関数
PHP Manual
アダルトレンタルサーバー