Well, I've made a product registration page, and I'm trying to get access to the product through the name, just like the wordpress system, but I could not find any support for that.
When you save the product, it generates a friendly URL such as "www.example.com/product/productname" so you can access it without having to use the ID on the link.
I have already tried working with str_replace
but it causes problems with special characters like spaces, quotation marks and others.