- utf8_decode: documentation ( source)
- htmlentities: documentation ( source)
- trim: documentation ( source)
- html_entity_decode: documentation ( source)
- preg_replace: documentation ( source)
- strtolower: documentation ( source)
<?php
$string = "fĂștbol";
$string = htmlentities(strtolower(utf8_decode($string)));
$string = preg_replace("/&(.)(acute|cedil|circ|ring|tilde|uml);/", "$1", $string);
$string = preg_replace("/([^a-z0-9]+)/", "-", html_entity_decode($string));
$string = trim($string, "-");
echo $string;