Abuse UpperCase String


/ Published in: PHP
Save to your folder(s)

use:


Copy this code and paste it in your HTML
  1. function validarAbusoMayusculas( $str ){
  2. return getStrSize( $str ) < 83 ? strtolower($str) : $str;
  3. }
  4. function getStrSize( $str ){
  5. $largo=strlen($str);
  6. $peso=0;
  7. for( $i=0;$i<$largo;++$i ) $peso = $peso + ord( $str[$i] );
  8. if( $largo > 0 ) return $peso/$largo;
  9. else return 100; #ok
  10. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.