B
B
BonBon Slick2017-02-03 10:04:02
Laravel
BonBon Slick, 2017-02-03 10:04:02

Which is better to use str_slug / urlencode?

str_slug - readable, no bugs.
urlencode - better for web crawlers? And here they write they say © and other similar commands can be injected.
Google encode your url.
However, I wonder which is better to use? Why?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Aksentiev, 2017-02-03
@BonBonSlick

https://github.com/laravel/framework/blob/7212b1e9...
it already replaces everything with latin

E
Eugene, 2017-02-03
@Nc_Soft

These are different functions for different purposes.
urlencode is needed for the correct transfer of get parameters, str_slug for SEO downs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question