Thanks Lars & Evan... much appreciated!
Justin French
on 07/06/02 2:13 PM, Lars Torben Wilson ([EMAIL PROTECTED]) wrote:
> On Thu, 2002-06-06 at 20:20, Justin French wrote:
>> Hi,
>>
>> How would I determine if there was a high % (say > 40%) of capital letters
>> in a string? I'm trying to t
On Thu, 2002-06-06 at 20:20, Justin French wrote:
> Hi,
>
> How would I determine if there was a high % (say > 40%) of capital letters
> in a string? I'm trying to think of a way of preventing endless use of
> capital letters in a message board, to stop YELLERS.
>
> Justin French
>
/* Perhaps something like this? */
// UNTESTED
$string = "ThE sTrInG tO tEsT";
function str2arr($str)
{
for ( $x = 0 ; $x < ( strlen($str) ) ; $x++ )
{
$arr[$x] = substr($str, $x, 1);
}
return $arr;
}
foreach ( (str2arr($string)) as $char )
{
3 matches
Mail list logo