Elgg  Version master
friendlytitle.php
Go to the documentation of this file.
1 <?php
9 $title = elgg_extract('title', $vars);
10 if (empty($title)) {
11  echo $title;
12  return;
13 }
14 
15 //$title = iconv('UTF-8', 'ASCII//TRANSLIT', $title);
16 $title = preg_replace('/[^\w ]/', '', $title);
17 $title = str_replace(' ', '-', $title);
18 $title = str_replace('--', '-', $title);
19 $title = trim($title);
21 
22 echo $title;
$title
Friendly title Makes a URL-friendly title.
elgg_strtolower()
Wrapper function for mb_strtolower().
Definition: mb_wrapper.php:125
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
$vars
Definition: theme.php:5