Revision: 17994
Updated Code
at September 19, 2009 00:13 by fetolio
Updated Code
function tourl($strText) { $strText = preg_replace('/ã|â|á|ä|à /i','a',$strText); $strText = preg_replace('/ê|é|ë|è/i','e',$strText); $strText = preg_replace('/î|Ã|ï|ì/i','i',$strText); $strText = preg_replace('/õ|ô|ó|ö|ò/i','o',$strText); $strText = preg_replace('/û|ú|ü|ù/i','u',$strText); $strText = str_ireplace(array('ç','ñ'),array('c','n'),$strText); $strText = preg_replace('/[^A-Za-z0-9-]/', ' ', $strText); $strText = preg_replace('/ +/', ' ', $strText); $strText = trim($strText); $strText = str_replace(' ', '-', $strText); $strText = preg_replace('/-+/', '-', $strText); $strText = strtolower($strText); return $strText; }
Revision: 17993
Updated Code
at September 19, 2009 00:12 by fetolio
Updated Code
function tourl($strText) { $strText = preg_replace('/ã|â|á|ä|à/i','a',$strText); $strText = preg_replace('/ê|é|ë|è/i','e',$strText); $strText = preg_replace('/î|ÃÂ|ï|ì/i','i',$strText); $strText = preg_replace('/õ|ô|ó|ö|ò/i','o',$strText); $strText = preg_replace('/û|ú|ü|ù/i','u',$strText); $strText = str_ireplace(array('ç','ñ'),array('c','n'),$strText); $strText = preg_replace('/[^A-Za-z0-9-]/', ' ', $strText); $strText = preg_replace('/ +/', ' ', $strText); $strText = trim($strText); $strText = str_replace(' ', '-', $strText); $strText = preg_replace('/-+/', '-', $strText); $strText = strtolower($strText); return $strText; }
Revision: 17992
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at September 19, 2009 00:08 by fetolio
Initial Code
function tourl($strText) { $strText = preg_replace('/ã|â|á|ä|à /i','a',$strText); $strText = preg_replace('/ê|é|ë|è/i','e',$strText); $strText = preg_replace('/î|Ã|ï|ì/i','i',$strText); $strText = preg_replace('/õ|ô|ó|ö|ò/i','o',$strText); $strText = preg_replace('/û|ú|ü|ù/i','u',$strText); $strText = str_ireplace(array('ç','ñ'),array('c','n'),$strText); $strText = preg_replace('/[^A-Za-z0-9-]/', ' ', $strText); $strText = preg_replace('/ +/', ' ', $strText); $strText = trim($strText); $strText = str_replace(' ', '-', $strText); $strText = preg_replace('/-+/', '-', $strText); $strText = strtolower($strText); return $strText; }
Initial URL
http://snipplr.com/view.php?codeview&id=9024
Initial Description
I've made some changes
Initial Title
String to URL generator - impoved
Initial Tags
url
Initial Language
PHP