*/
function setSEO($string, $max = false) {
// ESPAÑOL
$espanol = array('á','é','í','ó','ú','ñ');
$ingles = array('a','e','i','o','u','n');
// MINUS
$string = str_replace($espanol,$ingles,$string);
$string = trim($string);
$string = trim(preg_replace('/[^ A-Za-z0-9_]/', '-', $string));
$string = preg_replace('/[ \t\n\r]+/', '-', $string);
$string = str_replace(' ', '-', $string);
$string = preg_replace('/[ -]+/', '-', $string);
//
if($max) {
$string = str_replace('-','',$string);
$string = strtolower($string);
}
//
return $string;
}
/*