aboutsummaryrefslogtreecommitdiff
path: root/views/default/output/friendlytitle.php
blob: fbc4f39de221cb517acf19747ec2b27aa2077c14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;