Results 1 to 2 of 2
Threaded View
-
19th Sep 2015, 05:48 PM #1
SEO url string filter Using PHP
This function will transform any string to an seo url like string. It suports latin, french and german special characters.
Example: applying the function to "Exemplo de aplicação da função" returns "exemplo-de-aplicacao-da-funcao"
PHP Code:<?php
function seoUrl($str){
/** by Jonatas Urias B Teixeira **/
$a = array('/(à|á|â|ã|ä|å|æ)/','/(è|é|ê|ë)/','/(ì|í|î|ï)/','/(ð|ò|ó|ô|õ|ö|ø|œ)/','/(ù|ú|û|ü)/','/ç/','/þ/','/ñ/','/ß/','/(ý|ÿ)/','/(=|\+|\/|\\\|\.|\'|\_|\\n| |\(|\))/','/[^a-z0-9_ -]/s','/-{2,}/s');
$b = array('a','e','i','o','u','c','d','n','ss','y','-','','-');
return trim(preg_replace($a, $b, strtolower($str)),'-');
}
?>Kevin Reviewed by Kevin on . SEO url string filter Using PHP This function will transform any string to an seo url like string. It suports latin, french and german special characters. Example: applying the function to "Exemplo de aplicação da função" returns "exemplo-de-aplicacao-da-funcao" <?php function seoUrl($str){ /** by Jonatas Urias B Teixeira **/ $a = array('/(à|á|â|ã|ä|å|æ)/','/(è|é|ê|ë)/','/(ì|í|î|ï)/','/(ð|ò|ó|ô|õ|ö|ø|œ)/','/(ù|ú|û|ü)/','/ç/','/þ/','/ñ/','/ß/','/(ý|ÿ)/','/(=|\+|\/|\\\|\.|\'|\_|\\n| Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 2 users browsing this thread. (0 members and 2 guests)
Vn5socks.net 30-10-2024 | socks 5...
Live | 162.0.220.161:36709 | United States |...