I have the following code:
<?php
$actual_link = "domain.com/search/q/laptop/attr/price_range_11_50005/attr/23914175_laptop";
if ($attribute->name == "Price range")
{
if (strpos($actual_link,'/attr/price_range_') !== false)
{
$querystring = explode("&",preg_replace(array("/attr/price_range_[0-9_]+/", "", $actual_link)));
}
else
{
$querystring = explode("&",$actual_link);
}
}
}
For some reason its not working, the code should replace the current "/attr/price_range" with nothing on the url.