Need help for displaying records from a database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vcodeinfotec
Forum Newbie
Posts: 10
Joined: Sat Jul 12, 2008 2:08 am

Need help for displaying records from a database

Post 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
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: Need help for displaying records from a database

Post by Apollo »

$words = explode ( " " , $yourText );
array_splice( $words , 37 );

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

print( implode( " ", $words ) );
vcodeinfotec
Forum Newbie
Posts: 10
Joined: Sat Jul 12, 2008 2:08 am

Re: Need help for displaying records from a database

Post by vcodeinfotec »

Thanks :D . It works well..
Post Reply