Created
April 18, 2014 14:12
-
-
Save andrescifuentesr/11046255 to your computer and use it in GitHub Desktop.
A php function to cut a character chaine
This file contains 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
//---------------------------------------------------------------------------------------------------- | |
// Fonction pour limiter le nombre de caractere | |
//---------------------------------------------------------------------------------------------------- | |
function resume_xmots($MaChaine,$xmots) | |
{ | |
$ChaineTab=explode(" ",$MaChaine); | |
for($i=0;$i<$xmots;$i++) | |
{ | |
$NouvelleChaine.=" "."$ChaineTab[$i]"; | |
} | |
return $NouvelleChaine; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment