Skip to content

Instantly share code, notes, and snippets.

@andrescifuentesr
andrescifuentesr / Resume xmots
Created April 18, 2014 14:12
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]";
}