The relevant section in http://php.net/manual/en/function.ucwords.php
<?php
$foo = 'hello world!';
$foo = ucwords($foo); //Hello World!
$bar = 'HELLO WORLD!';
$bar = ucwords($bar); //HELLO WORLD!
$bar = ucwords(strtolower($bar));//Hello World!
?>
あなたの質問のために、私は次のように置き換えます:
// Prepare the database query
$stmt = mysqli_prepare($link, "SELECT * FROM table");
// Run the database query
mysqli_stmt_execute($stmt);
// Bind the result columns to PHP variables
mysqli_stmt_bind_result($stmt, $Name, $Title);
を使用して:
$results = mysqli_query("SELECT * FROM table");
whileループを次のように変更します。
foreach($results as $row) {
$xw->startElement('item');
$xw->writeElement('Name', ucwords(strtolower($row['name']));
$xw->writeElement('Title', ucwords(strtolower($row['title']));
$xw->endElement();
}
明らかに、私はあなたのデータベーススキーマを知らないので、これを修正する必要があります。
mysqliを変更する主な理由は、将来データベースのスキーマを変更すると、データベース列の順序が同じであるとは限りません。
がんばろう!