Skip to content

Instantly share code, notes, and snippets.

@phenix-factory
Created October 2, 2015 13:50
Show Gist options
  • Save phenix-factory/1dc0195bd655a654b9ef to your computer and use it in GitHub Desktop.
Save phenix-factory/1dc0195bd655a654b9ef to your computer and use it in GitHub Desktop.
SPIP: Filtre pour supprimer les ligne vide d'un squelette
<?php
/**
* Fonction de nettoyage des squelettes qui supprimer les ligne vides
* On passe par #FILTRE
*
* @param mixed $contenu
* @access public
* @return mixed
*/
function filtre_supprimer_ligne_vide_dist($contenu) {
return preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $contenu);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment