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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -