apple stuff
 array handling
 communication
 databases
 directories
 file handling
 forms
 html and code
 image editing
 image handling
 image listing
 information
 sessions and co
 string handling
 lixlpixel
php - snippets
google search terms detected and highlighted.
remove highlighting | keep highlighting
make snippet in "string handling" - download "Cutting Strings down to a number of Letters"
 search
php - snippets

Valid CSS!

php webring logo
prev next
random list
join the Ring!

string handling - Cutting Strings down to a number of Letters was created/last modified on Thu 05 Jan 2006 7:45 AM

<?php
 
function cut_text($html_code,$total_letters){
     
$html_code str_split($html_code,$total_letters);
     
$html_code $html_code[0]."...";
     return 
$html_code;    
 }
 
?>
 
 Call this with:
 
 <?php
 cut_text
('this is my wonderful text'60);
 
?>

learn more about some of the PHP functions used in this snippet: function, return, split

view the GNU general license - view the GNU library license - search on PHPsnippets - see your code like this

 a lixlpixel.com site

PHParadise.com - PHP-classes.org - your site on safari