Jump to content


This topic is now archived and is closed to further replies.


Using strotupper() not working?

Recommended Posts

I was hoping someone could help me out with this, it is pretty self-explanatory.

$sentence = "i wanna make the beginning letter capital only.";

// $words is now an array
$words = explode(" ", $sentence);

foreach ($words as $word)
$word = strtoupper(substr($word, 1, 1));
echo $word;

This outputs:

Thanks for any help you can give.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.