On Friday 03 September 2004 11:16 pm, Chris Martin wrote:
> Justin French wrote:
> > Hi all,
> >
> > I'm working with a bunch of users who hardly ever use correct
> > punctuation in their submitted content.  I realise there's very little I
> > can do, but I'm trying to do *something* to make things a little more
> > presentable.  At the very least, ensuring that all "sentences" begin
> > with a capital letter (english) would be a great start.
> >
> > Has any one come across a library of "punctuation cleaners" or something
> > like that?
> >
> > ---
> > Justin French
> > http://indent.com.au
>
> Check out the many wonderful string functions at
> http://php.net/strings
>
> In particular, for all uppercase, you'll probably find 'strtolower()'
> helpful. And, as Jim mentioned, ucfirst() will capitalize the first letter.
>
> There's a bunch more that can help you control what they're sending you.
> (Isn't it amazing what people will enter in a form??)
>
> --
> Chris Martin
> Web Developer
> Open Source & Web Standards Advocate
> http://www.chriscodes.com/



Hi Justin,

To add to what Chris mentioned, I always include this little snippet:

if (ereg("([A-Z][A-Z][A-Z][A-Z])", $_POST['request']))
{
        print "<h5><br><br><br><br>PLEASE SET 'CAPS LOCK' TO OFF <br><br>              
                                                                                       
                                                          
Then click 'Back' on your browser, and re-enter information.</h5></div>";
}

[I make the assumption that any word with three or more capitals deserves this 
message.]

Amazing how many people forget to add a space after a period, capitalize 
proper names, etc. I have a whole mess of little functions that clean up the 
glaring errors. However, in the long run, I've decided to let the 
less-glaring stuff through, but clean up the major ones.

Just my pence worth
Andre

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to