Last active
March 2, 2017 10:39
-
-
Save doxt3r/4968b1791bfee4907e288beafab44b1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Césure propre | |
function Cesure(){ | |
$content = strip_tags($mon_contenu); // cleaning input string | |
if (strlen($content) > 300) { | |
$contentCut = substr($content,0,300); | |
$content = substr($contentCut,0,strrpos($contentCut," "))." ..."; | |
} | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment