Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Limit number of words to be displayed on blog post excerpt with Laravel

Str::words($post->body,10);

//Use along with complete namespace, like this:

IlluminateSupportStr::words($post->body, 10);

IlluminateSupportStr::words($post->body, 10,'...');
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Limit #number #words #displayed #blog #post #excerpt #Laravel
ADD COMMENT
Topic
Name
6+3 =