Reputation: 2060
I have a URL variable that looks like this:
http://myURL?price_rang=2%5E%5E99_5%5E%5E99
With php echo on the price_rang GET var it translates to 25E5E99_55E5E99 .
I need it to be converted to 2.99_5.99 and then explode it and use the first and second part in a query.
What would be the best way to convert this string and explode it (or just convert it)?
Upvotes: 1
Views: 98
Reputation: 12132
Take it step by step.
Try the following:
$range = $_GET['price_rang'];
$range = str_replace("^^", ".", $range);
$val = explode("_", $range);
var_dump($val);
Upvotes: 1
Reputation: 2512
You need rawurldecode() or urldecode() function
$val = explode('_', rawurldecode($_GET['price_rang']));
Upvotes: 0