Created
September 12, 2014 17:02
-
-
Save Uriel29/65981117d3c5ba4d4ea2 to your computer and use it in GitHub Desktop.
Removendo acentos, convertendo espaços em hífen e convertendo para minúsculos utilizando Regex, strtolower e strtr no seblod.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$variavel = $cck->getValue('seu_campo'); | |
$variavel_limpa = strtolower( ereg_replace("[^a-zA-Z0-9-]", "-", strtr(utf8_decode(trim($variavel)), utf8_decode("áàãâéêíóôõúüñçÁÀÃÂÉÊÍÓÔÕÚÜÑÇ"),"aaaaeeiooouuncAAAAEEIOOOUUNC-")) ); | |
echo $variavel_limpa; | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment