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.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/views/default/output/friendlytitle.php b/views/default/output/friendlytitle.php
new file mode 100644
index 000000000..a92726f69
--- /dev/null
+++ b/views/default/output/friendlytitle.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Friendly title
+ * Makes a URL-friendly title.
+ *
+ * @uses string $vars['title'] Title to create from.
+ */
+
+
+$title = $vars['title'];
+
+$title = trim($title);
+$title = strtolower($title);
+$title = preg_replace("/[^\w ]/","",$title);
+$title = str_replace(" ","-",$title);
+$title = str_replace("--","-",$title);
+
+echo $title;