Page 1 of 1

text 'tidy up' function

Posted: Tue Sep 09, 2008 10:24 am
by mrgooding
Hi All

Just a quick question on a function to tidy up text - I can't seem to work out whether my function is incorrect or the way i'm trying to use it is correct:

Code: Select all

function tidytext($textstring)
{
$textstring = ucfirst(strtolower($textstring));
return $textstring;
}   
Is the function itself, and:

Code: Select all

$text1='iAMbadlyforMATTED';
tidytext($text1);
Echo $text1;
still echo's iAMbadlyforMATTED, not Iambadlyformatted, as i'd hoped.

Any ideas why this won't work? Cheers in advance.

Re: text 'tidy up' function

Posted: Tue Sep 09, 2008 10:42 am
by mrgooding
solved it - had forgotten to put $text1 = tidytext($text1);

Hope this helps somebody!