echo - PHP Description Excerpt -
I have the following code and it needs to resound 100 words or less in the description rather than just the entire description. Is there a way to do this by editing this code?
public static function getExcerpt ($ profile) {$ out = ''; If ($ profile ['description'])) {$ out. $ $ [Profile ']' ' '.__('', 'love story'); } Return Out $; } Thanks! 100 characters for
// ... if (strangel ($ profile ['description] ']) Gt; 100) $ description = substr ($ profile [' description '], 0, 100). "..."; And $ details = $ profile ['description']; $ Out. = $ Details ''. __('', 'love story'); 100 words for // $ out. = Implode ("", array_slice (explosion ("", $ profile ['description']), 0, 100)). ' '.__('', 'love story');
Comments
Post a Comment