comparison includes/class.textutils.php @ 10:8f1125d27079

Ajout de deux fonctions helpers qui permettent d'harmoniser le code.
author Franck Deroche <webmaster@defr.org>
date Wed, 24 Oct 2007 14:38:08 +0200
parents 629389204276
children ec0c926a78a6
comparison
equal deleted inserted replaced
9:3b22cee5e07b 10:8f1125d27079
24 $arOld = TextUtils::SplitTags($old); 24 $arOld = TextUtils::SplitTags($old);
25 $arNew = TextUtils::SplitTags($new); 25 $arNew = TextUtils::SplitTags($new);
26 $ajout = array_diff($arNew, $arOld); 26 $ajout = array_diff($arNew, $arOld);
27 $suppr = array_diff($arOld, $arNew); 27 $suppr = array_diff($arOld, $arNew);
28 } 28 }
29
30 public static function StripTitle($Titre) {
31 $Titre_url = str_replace(" ", "_", strip_tags($Titre));
32 $Titre_url = str_replace("-", "_", $Titre_url);
33 $Titre_url = str_replace(array("é", "è"), "e", $Titre_url);
34 $Titre_url = str_replace("à", "a", $Titre_url);
35 $Titre_url = str_replace("ù", "u", $Titre_url);
36 $Titre_url = str_replace(array("î", "ï"), "i", $Titre_url);
37 return $Titre_url;
38 }
39
40 public static function getMonthName($monthNumber) {
41 return ucfirst(strftime('%B', strtotime('2007-' . $monthNumber . '-01')));
42 }
29 } 43 }
30 ?> 44 ?>