Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A php function to cut a character chaine
//----------------------------------------------------------------------------------------------------
// 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