note 89710 deleted from function.mb-strlen by danbrown

From: Date: Fri, 20 Mar 2009 12:56:50 +0000
Subject: note 89710 deleted from function.mb-strlen by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-152201@lists.php.net to get a copy of this message
Note Submitter: Amaroq ---- When dealing with submitted forms that you've imposed a character limit on, you must remember that functions that count characters consider "\r\n" to be two characters. <?php //These will both output 2. echo strlen("\r\n"); echo mb_strlen("\r\n"); ?> If I had thought of this starting out, I would have saved myself several hours of trouble trying to get php to cut a message to the same length that my auxiliary javascript validation imposed on it.

« previous php.notes (#152201) next »