How to get capital letters from a string?
Posted: Wed Jul 21, 2004 7:51 pm
What is the best way to get the capital letters from a string?
ex:
ex:
Code: Select all
<?php
$myString = 'HereIsMyStringMcDonald';
echo getCapitalLetters($myString );
//Would return: HIMSMD
function getCapitalLetters($str){
//extract capital letters and return
}
?>