array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'intlchar.totitle.php', 1 => 'IntlChar::totitle', ), 'up' => array ( 0 => 'class.intlchar.php', 1 => 'IntlChar', ), 'prev' => array ( 0 => 'intlchar.tolower.php', 1 => 'IntlChar::tolower', ), 'next' => array ( 0 => 'intlchar.toupper.php', 1 => 'IntlChar::toupper', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'es', 'path' => 'reference/intl/intlchar/totitle.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 7, PHP 8)
IntlChar::totitle — Convertir un carácter Unicode a letra titular
Se hace corresponder el carácter dado con su equivalente de letra titular. Si el carácter no tiene dicho equivalente, se devuelve el carácter en sí.
Devuelve el Simple_Titlecase_Mapping del punto de código, si lo hubiera; de lo contrario devuelve el punto de código en sí.
El tipo devuelto será integer a menos que el punto de código se pase como un string UTF-8, en cuyo caso será devuelto un string.
Ejemplo #1 Probar diferentes puntos de código
<?php
var_dump(IntlChar::totitle("A"));
var_dump(IntlChar::totitle("a"));
var_dump(IntlChar::totitle("Φ"));
var_dump(IntlChar::totitle("φ"));
var_dump(IntlChar::totitle("1"));
var_dump(IntlChar::totitle(ord("A")));
var_dump(IntlChar::totitle(ord("a")));
?>
El resultado del ejemplo sería:
string(1) "A" string(1) "A" string(2) "Φ" string(2) "Φ" string(1) "1" int(65) int(65)