<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.strings.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.ucwords.php',
    1 => 'ucwords',
    2 => 'Wandelt jeden ersten Buchstaben eines Wortes innerhalb eines Strings in
   einen Gro&szlig;buchstaben um',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => 'String-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.ucfirst.php',
    1 => 'ucfirst',
  ),
  'next' => 
  array (
    0 => 'function.utf8-decode.php',
    1 => 'utf8_decode',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/strings/functions/ucwords.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ucwords" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ucwords</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ucwords</span> &mdash; <span class="dc-title">
   Wandelt jeden ersten Buchstaben eines Wortes innerhalb eines Strings in
   einen Großbuchstaben um
  </span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ucwords-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ucwords</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$string</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$separators</code><span class="initializer"> = &quot; \t\r\n\f\v&quot;</span></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="para rdfs-comment">
   Gibt einen String zurück, in dem das erste Zeichen eines jeden Wortes
   innerhalb von <code class="parameter">string</code> in einen Großbuchstaben
   umgewandelt wird, sofern es ein ASCII-Zeichen im Bereich von
   <code class="literal">&quot;a&quot;</code> (0x61) bis <code class="literal">&quot;z&quot;</code> (0x7a) ist.
  </p>
  <p class="para">
   Bei dieser Funktion ist ein Wort ein Folge von Zeichen, die nicht im
   Parameter <code class="parameter">separators</code> aufgeführt sind. Standardmäßig
   sind dies: Leerzeichen, horizontaler Tabulator, Wagenrücklauf,
   Zeilenumbruch, Seitenvorschub und vertikaler Tabulator.
  </p>
  <p class="para">
   Um eine ähnliche Umwandlung bei Multibyte-Zeichenfolgen vorzunehmen, muss
   die Funktion <span class="function"><a href="function.mb-convert-case.php" class="function">mb_convert_case()</a></span> mit dem Modus
   <strong><code><a href="mbstring.constants.php#constant.mb-case-title">MB_CASE_TITLE</a></code></strong> verwendet werden.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ucwords-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       Die Eingabezeichenkette.
      </p>
     </dd>
    
    
     <dt><code class="parameter">separators</code></dt>
     <dd>
      <p class="para">
       Der optionale Parameter <code class="parameter">separators</code> enthält die
       Wort-Trenzeichen.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ucwords-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt die modifizierte Zeichenkette zurück.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.ucwords-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     
 <tr>
  <td>8.2.0</td>
  <td>
   Die Umwandlung von Groß- und Kleinschreibung hängt nicht mehr von der mit
   <span class="function"><a href="function.setlocale.php" class="function">setlocale()</a></span> eingestellten Locale ab. Es werden nur
   ASCII-Zeichen umgewandelt.
  </td>
 </tr>


    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.ucwords-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>ucwords()</strong></span>-Beispiel</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$foo </span><span style="color: #007700">= </span><span style="color: #DD0000">'hallo welt!'</span><span style="color: #007700">;<br />echo </span><span style="color: #0000BB">ucwords</span><span style="color: #007700">(</span><span style="color: #0000BB">$foo</span><span style="color: #007700">), </span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;             </span><span style="color: #FF8000">// Hallo Welt!<br /><br /></span><span style="color: #0000BB">$bar </span><span style="color: #007700">= </span><span style="color: #DD0000">'HALLO WELT!'</span><span style="color: #007700">;<br />echo </span><span style="color: #0000BB">ucwords</span><span style="color: #007700">(</span><span style="color: #0000BB">$bar</span><span style="color: #007700">), </span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;             </span><span style="color: #FF8000">// HALLO WELT!<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">ucwords</span><span style="color: #007700">(</span><span style="color: #0000BB">strtolower</span><span style="color: #007700">(</span><span style="color: #0000BB">$bar</span><span style="color: #007700">)), </span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">; </span><span style="color: #FF8000">// Hallo Welt!<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-2">
    <p><strong>Beispiel #2 <span class="function"><strong>ucwords()</strong></span>-Beispiel mit benutzerdefinierten Trenzeichen</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$foo </span><span style="color: #007700">= </span><span style="color: #DD0000">'hallo|welt!'</span><span style="color: #007700">;<br />echo </span><span style="color: #0000BB">ucwords</span><span style="color: #007700">(</span><span style="color: #0000BB">$foo</span><span style="color: #007700">), </span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;             </span><span style="color: #FF8000">// Hallo|welt!<br /><br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">ucwords</span><span style="color: #007700">(</span><span style="color: #0000BB">$foo</span><span style="color: #007700">, </span><span style="color: #DD0000">"|"</span><span style="color: #007700">), </span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;        </span><span style="color: #FF8000">// Hallo|Welt!<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-3">
    <p><strong>Beispiel #3 <span class="function"><strong>ucwords()</strong></span>-Beispiel mit zusätzlichen Trennzeichen</strong></p>
    <div class="example-contents">
     <div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$foo </span><span style="color: #007700">= </span><span style="color: #DD0000">"mike o'hara"</span><span style="color: #007700">;<br />echo </span><span style="color: #0000BB">ucwords</span><span style="color: #007700">(</span><span style="color: #0000BB">$foo</span><span style="color: #007700">), </span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;                 </span><span style="color: #FF8000">// Mike O'hara<br /><br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">ucwords</span><span style="color: #007700">(</span><span style="color: #0000BB">$foo</span><span style="color: #007700">, </span><span style="color: #DD0000">" \t\r\n\f\v'"</span><span style="color: #007700">), </span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">; </span><span style="color: #FF8000">// Mike O'Hara<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.ucwords-notes">
  <h3 class="title">Anmerkungen</h3>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: <span class="simpara">Diese Funktion ist
binärsicher.</span></p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ucwords-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.strtoupper.php" class="function" rel="rdfs-seeAlso">strtoupper()</a> - Wandelt alle Zeichen eines Strings in Gro&szlig;buchstaben um</span></li>
    <li><span class="function"><a href="function.strtolower.php" class="function" rel="rdfs-seeAlso">strtolower()</a> - Setzt einen String in Kleinbuchstaben um</span></li>
    <li><span class="function"><a href="function.ucfirst.php" class="function" rel="rdfs-seeAlso">ucfirst()</a> - Verwandelt das erste Zeichen eines Strings in einen Gro&szlig;buchstaben</span></li>
    <li><span class="function"><a href="function.mb-convert-case.php" class="function" rel="rdfs-seeAlso">mb_convert_case()</a> - Perform case folding on a string</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>