/ Published in: 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"
Example: applying the function to "Exemplo de aplicação da função" returns "exemplo-de-aplicacao-da-funcao"
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php function seoUrl($str){ /** by Jonatas Urias B Teixeira **/ $a = array('/(à |á|â|ã|ä|Ã¥|æ)/','/(è|é|ê|ë)/','/(ì|Ã|î|ï)/','/(ð|ò|ó|ô|õ|ö|ø|Å“)/','/(ù|ú|û|ü)/','/ç/','/þ/','/ñ/','/ß/','/(ý|ÿ)/','/(=|\+|\/|\\\|\.|\'|\_|\\n| |\(|\))/','/[^a-z0-9_ -]/s','/-{2,}/s'); } ?>
URL: http://tinyphp.tumblr.com/post/3750074024/php-seo-url-string-filter