Yo everybody, here is a PHP Script with a function named "Cut" which can cut a "cut" a string for example: <?php include("./cut.php"); echo Cut("Tobi is a good boy!", 12); ?> PHP: The result from this script will be "Tobi is a go..." Well here's the script: <?php function Cut($text,$len) { $string = $text; $string_num = strlen($string); if($string_num > $len) { $string = substr($string,0,$len); echo $string . "..."; } else { echo $string; } return $string; } /* Function created by Scripten Site/Portfolio: None for now :) E-mail: scriptenx@yahoo.com */ ?> PHP: Hope u like it
function cut( $text, $length = 6 ) { return strlen( $text ) > $length ? substr( $text, 0, $length ) . '...' : $text; } PHP: