[Fusionforge-commits] r11066 - trunk/src/common/include

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Tue Oct 19 21:13:20 CEST 2010


Author: aljeux
Date: 2010-10-19 21:13:20 +0200 (Tue, 19 Oct 2010)
New Revision: 11066

Modified:
   trunk/src/common/include/utils.php
Log:
Add util_strip_accents() for later use.

Modified: trunk/src/common/include/utils.php
===================================================================
--- trunk/src/common/include/utils.php	2010-10-19 19:13:14 UTC (rev 11065)
+++ trunk/src/common/include/utils.php	2010-10-19 19:13:20 UTC (rev 11066)
@@ -1007,6 +1007,19 @@
 }
 
 /**
+ * util_strip_accents() - Remove accents from given text.
+ * @param	string	Text
+ * @return 	string
+ */
+function util_strip_accents($text) {
+	$find = utf8_decode($text);
+	$find = strtr($find,
+		utf8_decode('àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ'),
+		'aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY');
+	return utf8_encode($find);
+}
+
+/**
  * Constructs the forge's URL prefix out of forge_get_config('url_prefix')
  * 
  * @return string




More information about the Fusionforge-commits mailing list