-11

I have this word:

katii

But I want the first character in uppercase K. How can I do this?

Rizier123
  • 58,877
  • 16
  • 101
  • 156
blood
  • 35
  • 3

3 Answers3

0

Use function usfirst

  string ucfirst ( string $str )
Panther
  • 3,312
  • 9
  • 27
  • 50
  • 5
    While I'm aware that answering is completely up to the individual user, I really do wish people would stop answering questions like this as it has a negative effect of making people believe they will get a answer without having to do any form of research, and not care about SO's rules. – Epodax Sep 15 '15 at 10:59
0

You can use below as prescribed by php.net

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

$bar = 'HELLO WORLD!';
$bar = ucfirst($bar);             // HELLO WORLD!
$bar = ucfirst(strtolower($bar)); // Hello world!
?>
Kuldeep
  • 83
  • 1
  • 9
  • I need Just first of the worn not all the word just H i want to get not all the word how can i do that thanks in advance – blood Sep 15 '15 at 11:21
0
$upper = strtoupper(substr('katii', 0, 1)); //K

You should make your question a little clearer in future, though.

Martyn Shutt
  • 1,671
  • 18
  • 25