i have a problem getting the value of an url variable if it has & in it for example i have cat=Hospitality+&+Tourism+Services
. When i $_GET
the value of cat
it stops after Hospitality because i have a & inside it. I encoded url but it still get's me only the first part of variable.
$cat=$_GET['cat'];
echo $cat;
this display Hospitality instead Hospitality & Tourism Services
How can i solve this? thnx in advance!
edit
this is my encoded url:
<a class="btn" href="/<?php echo $nume_categ; ?>/<?php echo urlencode($cat['Nume_Subcat']); ?>.php" role="button"><?php echo $cat['Nume_Heb']; ?><br><?php echo $cat['Nume_Subcat']; ?></a>
i also have a mod_rewrite for it here it is:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)/([^/]*)\.php$ /produse.php?category=$1&cat=$2 [L]