I'm retrieving menus from database and some of them have an apostrophe - ' - in their names. In a part of my code I have to compare the name from the database with the url, but it fails when the url has an apostrophe.
For example:
when I get the name from the db I get it as it is: foo's
but from the url, even if the url is web.com?menu=foo's
when I do this:
$menu = urldecode($_GET['menu']);
I get only foo
this is my htaccess Rewrite
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteRule ^explore/([0-9a-zA-Z\ ]+) renderpage.php?menu=$1 [L]
I've tried all the possible combination in my php, it's not that, it is this RewriteRule that doesn't allow apostrophe, I've also tried ([0-9a-zA-Z\ ']+)
in my regex and ([0-9a-zA-Z\ \']+)
but to no avail.