From 60b567845c6000a87a5363e92a6ba38358e6ee34 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 1 Oct 2010 17:30:28 +0200 Subject: [PATCH] functions.php : Added replaceSpaces() function --- public_html/includes/functions.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/public_html/includes/functions.php b/public_html/includes/functions.php index 6ebba942..a65a0a6f 100644 --- a/public_html/includes/functions.php +++ b/public_html/includes/functions.php @@ -530,4 +530,21 @@ function LSdebugDefined() { return strtr($string, $replaceAccent); } + + /** + * Supprime les espaces d'une chaine en les remplacant par un motif ou non + * + * @param[in] $str La chaine originale + * @param[in] $to Le motif de remplacement. S'il n'est pas spécifié, les espaces seront simplement supprimés + * + * @retval string La chaine sans les espaces + **/ + function replaceSpaces($str,$to='') { + return strtr($str,array ( + ' ' => $to, + "\t" => $to + ) + ); + } + ?>