Php > Strings
Word count like function Ver.1.0! This function can count your input text
Word count like function Ver.1.0! This function can count your input text and display only part of it (like a description) without cutting words in half function smart_text ($text_input_var[string] ,text_length[int]) { $strip_content=stripslashes($content); $all_content=strlen("$strip_content"); $standard_content=substr($strip_content ,$text_length); $compare=stristr($standard_content ," "); $minus_content=strlen("$compare"); $result_content=$all_content-$minus_content; $display_content=substr($strip_content ,0, $result_content); $striped_content=stripslashes($display_content); echo nl2br($striped_content); } For example i insert a 300 words test but only want about 3 rows of it to be displayed without cutting words in half. function smart_text($text,200) Displayed result will be the first 200 letters of the text plus the letters till the first space char.
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage