How to make first letter of a word capital?

那年仲夏 提交于 2019-11-27 14:49:42
fabrik

You may want to use ucfirst().

For multibyte strings, please see this snippet.

ucfirst capitalizes the first letter in a string.

ucwords capitalizes every word in a string.

Hello Geeta you can simply use ucwords() php function to make every first letter of your word Upper Cased!

Hope this would help!

I think that http://se2.php.net/manual/en/function.ucwords.php is the best function here :)

talk lampdeveloper

This is the code you need:

<?php

$string = 'stackoverflow';
$string = ucfirst($string);
echo $string;

?>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!