# Convert wholly capitalized words in a string into uppercase first only

**URL:** <https://forum.kirupa.com/t/convert-wholly-capitalized-words-in-a-string-into-uppercase-first-only/330714>\
**Category:** programming\
**Created:** [March 5, 2013, 8:43pm UTC](https://forum.kirupa.com/t/convert-wholly-capitalized-words-in-a-string-into-uppercase-first-only/330714 "2013-03-05T20:43:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![darroosh](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@darroosh](https://forum.kirupa.com/u/darroosh)\
**Post date:** [March 5, 2013, 8:43pm UTC](https://forum.kirupa.com/t/convert-wholly-capitalized-words-in-a-string-into-uppercase-first-only/330714/1 "2013-03-05T20:43:40Z")

</div>

Hi all,

I have a string in which I want to find any wholly uppercase word (e.g. TEST ) and then convert it into ( Test ) using php .

I can’t code it , headache after many trials !

Can someone help ?

Hint : I can’t use explode(" ",$string ) to convert it into an array to itreate it … Because the string words are not only separated by spaces , but some words are separated by

Regards,  
Dr Mostafa
