Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function QuebraDeLinha($string, $max = 50, $quebra = "\n"){
- if( strlen($string) > $max ){
- $strings = explode(' ',$string);
- foreach($strings as $a => $b ){
- if( strlen( $tmp.' '.$b ) > $max ){
- $str_tmp .= $tmp.$quebra;
- $tmp = '';
- }else{
- $tmp .= ' '.$b;
- }
- }
- }else{
- $str_tmp = $string;
- }
- return $str_tmp;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement