Problem creating SLUG in codeIgniter

Asked

Viewed 192 times

4

Look, I’m developing the portal for my record label, and I’m having a really boring problem.

I am logging the news, names of Albums, names of artists and so on.

When I register in the BD I play in a field the original name of the artist and in the other field the name to URL using the function url_title.

The problem is that when the artist’s name has special accents for example: á ê ô í ú à, etc, it saves the name without this character, but without replacing by a e o i u, then the field is empty and the incomplete name, the URL is not friendly.

I’ve tried using the str_replace but I was unsuccessful, it replaced the characters in wrong ways too.

Someone can give me a light or some solution?

  • No, you can post the code you already have? so it is easier for those who help, already have an idea of what you intend to do.

1 answer

2


  • 1

    Great that you were able to solve, when possible mark your answer as accepted. =)

  • I recommend concatenating your generated Slug with a number if your post is repeated (if it is stored in the database): ex www.seusite.com/postagem/bolos-em-sao-paulo www.seusite.com/postagem/bolos-em-sao-paulo-2

  • Thanks even to all. And Jhonatan, I’m using so yes, only that this session of the site, would be name cds, so would not have an equal name got? hehe

Browser other questions tagged

You are not signed in. Login or sign up in order to post.