Page 1 of 1

Need help for displaying records from a database

Posted: Sat Jul 12, 2008 2:20 am
by vcodeinfotec
Hi,
Anybody can help to split the data from a field of database table using php? I need to display a specific number of words from a large text area (from a record) using php. How can display it?

Expect help from anybody..

Thanks

Re: Need help for displaying records from a database

Posted: Sat Jul 12, 2008 2:44 am
by Apollo
$words = explode ( " " , $yourText );
array_splice( $words , 37 );

// $words is now an array with the first 37 words

print( implode( " ", $words ) );

Re: Need help for displaying records from a database

Posted: Sat Jul 12, 2008 3:12 am
by vcodeinfotec
Thanks :D . It works well..