Saving of sent messages works..kinda
[squirrelmail.git] / functions / strings.php
index ba2e137612aebc679df0f299decde3be93fd8927..b40510cfd8967685e945131707f1cb20f85d09ad 100644 (file)
    function replace_escaped_spaces ($string) {
       return str_replace(" ", " ", $string);
    }
+
+   function count_chars($string) {
+      for ($i = 0; $i < strlen($string); $i++) {
+         $ch = substr($string, $i, 1);
+         $size++;
+         if ($ch == "\\") {
+            $i++;   
+            $ch = substr($string, $i, 1);
+            if ($ch == "n")
+               $i--;
+            if ($ch == "r")
+               $i--;
+         }   
+      }   
+      return $size;
+   }
 ?>