3
I am using friendly urls and to generate the link, I am using this way:
$string = $jm->NomeCategoria; // retorna roupa de verão
$hifen = preg_replace('/[ -]+/' , '-' , $string); // incluo o hífen
$acentos = preg_replace( '/[`^~\'"]/', null, iconv( 'UTF-8', 'ASCII//TRANSLIT', $hifen)); // retiro as acentuações
With these commands he returns: summer wear. Only I need to recover on another page a string correct summer clothes, because I need to check the database. I was able to remove the hyphen and place the spaces, as it is possible to "return" the accents of a string?
You can not pass two variables ? the original and the result with hyphenation and without accents ?
– AnthraxisBR
Well... I also thought about creating in the database, when creating the categories, another field called url and when registering, generate the friendly link and then recover... but if you had a simpler way....
– user24136
I think there’s no way, unless you create a dictionary for your categories, but it would end up turning into the same thing as having another field in the comic book
– AnthraxisBR
Because you do not save the variable "summer clothes" in a Session like this
$_SESSION['url'] = $jm->NomeCategoria;
– Vinicius Shiguemori