aboutsummaryrefslogtreecommitdiff
path: root/views/default/output/friendlytitle.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/output/friendlytitle.php')
-rw-r--r--views/default/output/friendlytitle.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/views/default/output/friendlytitle.php b/views/default/output/friendlytitle.php
new file mode 100644
index 000000000..fbc4f39de
--- /dev/null
+++ b/views/default/output/friendlytitle.php
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Friendly title
+ * Makes a URL-friendly title.
+ *
+ * @uses string $vars['title'] Title to create from.
+ */
+
+
+$title = $vars['title'];
+
+//$title = iconv('UTF-8', 'ASCII//TRANSLIT', $title);
+$title = preg_replace("/[^\w ]/","",$title);
+$title = str_replace(" ","-",$title);
+$title = str_replace("--","-",$title);
+$title = trim($title);
+$title = strtolower($title);
+
+echo $title;