Sanitizes title, replacing whitespace with dashes.

Limits the output to alphanumeric characters, underscore (_) and dash (-).
Whitespace becomes a dash.

@param  string $title The title to be sanitized.
@return string The sanitized title.
428966
public static function slugify($title, $length = 200) {
        $title = strip_tags($title);
        // Preserve escaped octets.
        $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);
        // Remove percent signs that are not part of an octet.
        $title = str_replace('%', '', $title);
        // Restore octets.
        $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);
        $title = self::removeAccents($title);
        if (self::seemsUtf8($title)) {
            if (function_exists('mb_strtolower')) {
                $title = mb_strtolower($title, 'UTF-8');
            }
            $title = self::utf8UriEncode($title, $length);
        }
        $title = strtolower($title);
        $title = preg_replace('/&.+?;/', '', $title); // kill entities
        $title = preg_replace('/[^%a-z0-9 _-]/', '', $title);
        $title = preg_replace('/\s+/', '-', $title);
        $title = preg_replace('|-+|', '-', $title);
        $title = trim($title, '-');

        return $title;
    }
8580
protected function getBreadcrumbsContent($title)
    {
        if (!$stub = $this->getBreadcrumbsStub()) {
            return '';
        }

        return strtr($stub, array_merge($this->getCommonReplacements(), [
            '{{title}}' => ucfirst($title),
        ]));
    }
779133
public function _htmlHeader($title)
    {

        $output = $this->_doctype();
        $output .= '<html lang="en">'."\n";
        $output .= "<head>\n\n";

        $output .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'."\n\n";
        $output .= '<meta name="generator" content="PHPDoctor '.$this->_doclet->version().' (http://peej.github.com/phpdoctor/)">'."\n";
        $output .= '<meta name="when" content="'.gmdate('r').'">'."\n\n";

        $output .= '<link rel="stylesheet" type="text/css" href="'.str_repeat('../', $this->_depth).'stylesheet.css">'."\n";
        $output .= '<link rel="start" href="'.str_repeat('../', $this->_depth).'namespaces.html">'."\n\n";

        $output .= '<title>';
        if ($title) {
            $output .= $title.' ('.$this->_doclet->windowTitle().')';
        } else {
            $output .= $this->_doclet->windowTitle();
        }
        $output .= "</title>\n\n";
        $output .= "</head>\n";

        return $output;

    }
118184
public function setTitle($title)
    {

        if (!empty($title)) {
            $this->title = $title;
        } else if (isset($this->title)) {
            unset($this->title);
        }

    }
1290442
public function generateSlug($title)
    {
        $title = strtolower($title);
        $title = preg_replace('/[^%a-z0-9 _-]/', '', $title);
        $title = preg_replace('/\s+/', '-', $title);
        $title = preg_replace('|-+|', '-', $title);
        $title = trim($title, '-');

        return $title;
    }
813765
protected function getUnifiedTitle($title)
    {
        $title = mb_strtolower($title, 'utf8');
        $title = preg_replace('/\W+/u', ' ', $title);

        return trim($title);
    }
264173
protected function setTitle($title)
    {
        $title = trim(preg_replace('/\s\s+/', ' ', str_replace("\n", " ", $title)));

        if ($title != '') {
            $this->title = $title;
        }
    }
1218956
public function setTitle( $title ) {
		if ( $this->title !== $title ) {
			$this->title = $title;
			$this->updateTitle();
		}

		return $this;
	}
304865
public function setTitle($title)
    {
        $this->setAutoDiscoverTitle($title === null);
        $this->title = $title;

        return $this;
    }
1219825
public function admin_title( array $title ) {
		$data = $this->collector->get_data();
		if ( isset( $data['log'] ) ) {
			$title[] = $this->title . ' (' .	count( $data['log'] ) . ')';
		}
		return $title;
	}
654797
private function setTitle(string $title): FullNameEmbeddableInterface
    {
        $this->notifyEmbeddablePrefixedProperties(
            'title',
            $this->title,
            $title
        );
        $this->title = $title;

        return $this;
    }
907347
public function setTitle(string $title) {
        if($this->setModified('title', $title)->isModified()) {
            $this->title = $title;
        }

        return $this;
    }
347391
public function setTitle($title)
    {
        $this->title = $title;
        if($this->metaTitle == '') $this->metaTitle = $this->title;

        return $this;
    }
498112
public function title(string $title)
    {
        $name = config('app.name');

        if (empty($this->subject) && ! is_null($name)) {
            $this->subject(sprintf('[%s] %s', $name, $title));
        }

        $this->title = $title;

        return $this;
    }
455679
public static function getRssTitle($title = '')
    {
        $title = esc_html(trim(strip_tags($title)));
        $title = (empty($title)) ? __('Untitled', 'modularity') : $title;

        return $title;
    }
747878
public static function sanitizeCategoryName($value)
    {
        $output = preg_replace('/\s+/', '-', trim($value));
        $output = preg_replace('/[^a-z0-9\-]/', '',  strtolower($output));
        $output = preg_replace('/^[0-9\-_]+/', '',  strtolower($output));
        return substr($output, 0, 32);
    }
1344680
protected function _sanitize($value)
    {
        $value = parent::_sanitize($value);
        $pattern = '/[()<\/>\"\']*/';
        $value = preg_replace_callback($pattern, function($matches) { return '';} , $value);

        return $value;
    }