ucfirst

(PHP 4, PHP 5, PHP 7)

ucfirst锟斤拷锟街凤拷锟斤拷锟斤拷锟斤拷锟斤拷母转锟斤拷为锟斤拷写

说锟斤拷

ucfirst ( string $str ) : string

锟斤拷 str 锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷锟斤拷锟斤拷址锟斤拷锟斤拷锟侥革拷锟阶拷锟轿拷锟叫达拷锟侥革拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷

注锟斤拷锟斤拷母锟侥讹拷锟斤拷取锟斤拷锟节碉拷前锟斤拷锟斤拷锟借定锟斤拷锟斤拷锟界,锟斤拷默锟较碉拷 "C" 锟斤拷锟斤拷锟街凤拷 umlaut-a锟斤拷?锟斤拷锟斤拷锟斤拷锟结被转锟斤拷锟斤拷

锟斤拷锟斤拷

str

锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟斤拷锟截斤拷锟斤拷址锟斤拷锟斤拷锟�

锟斤拷锟斤拷

Example #1 ucfirst() 锟斤拷锟斤拷

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

$bar 'HELLO WORLD!';
$bar ucfirst($bar);             // HELLO WORLD!
$bar ucfirst(strtolower($bar)); // Hello world!
?>

锟轿硷拷

  • lcfirst() - 使一锟斤拷锟街凤拷锟斤拷锟侥碉拷一锟斤拷锟街凤拷小写
  • strtolower() - 锟斤拷锟街凤拷锟斤拷转锟斤拷为小写
  • strtoupper() - 锟斤拷锟街凤拷锟斤拷转锟斤拷为锟斤拷写
  • ucwords() - 锟斤拷锟街凤拷锟斤拷锟斤拷每锟斤拷锟斤拷锟绞碉拷锟斤拷锟斤拷母转锟斤拷为锟斤拷写